Skip to content

Do not use erroneous thumb url util function #2901

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 4 commits into from
Apr 20, 2019

Conversation

maskaravivek
Copy link
Member

Description (required)

Fixes #2899
Fixes #2900

@codecov-io
Copy link

codecov-io commented Apr 20, 2019

Codecov Report

Merging #2901 into master will decrease coverage by 0.03%.
The diff coverage is 25%.

Impacted file tree graph

@@            Coverage Diff            @@
##           master   #2901      +/-   ##
=========================================
- Coverage    3.42%   3.39%   -0.04%     
=========================================
  Files         246     246              
  Lines       12252   12212      -40     
  Branches     1080    1080              
=========================================
- Hits          420     414       -6     
+ Misses      11802   11768      -34     
  Partials       30      30
Impacted Files Coverage Δ
app/src/main/java/fr/free/nrw/commons/Media.java 0.68% <ø> (-5.44%) ⬇️
...free/nrw/commons/utils/MediaDataExtractorUtil.java 88.88% <ø> (+41.83%) ⬆️
app/src/main/java/fr/free/nrw/commons/Utils.java 18.03% <ø> (+0.84%) ⬆️
...ava/fr/free/nrw/commons/review/ReviewActivity.java 0% <0%> (ø) ⬆️
...ommons/contributions/ContributionsSyncAdapter.java 0% <0%> (ø) ⬆️
.../java/fr/free/nrw/commons/review/ReviewHelper.java 86.48% <100%> (+0.77%) ⬆️
.../fr/free/nrw/commons/nearby/NearbyMapFragment.java 0% <0%> (ø) ⬆️

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update accb880...293a939. Read the comment docs.

@maskaravivek maskaravivek changed the title Do not use erroneous thumb url util function [WIP] Do not use erroneous thumb url util function Apr 20, 2019
@maskaravivek maskaravivek changed the title [WIP] Do not use erroneous thumb url util function Do not use erroneous thumb url util function Apr 20, 2019
@maskaravivek
Copy link
Member Author

The database no longer saves invalid URLs. The URLs saved are directly taken from the API. Otherwise null is stored. In a different PR, we can have logic for fallback images.

Tested the following:

Image loading in peer review:

peer_image_loading

Category loading in peer review:

peer_categories

Image upload:

image_upload

reviewController.onImageRefreshed(fileName); //file name is updated
compositeDisposable.add(reviewHelper.getFirstRevisionOfFile("File:" + fileName)
compositeDisposable.add(reviewHelper.getFirstRevisionOfFile(fileName)
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I know this is beyond the scope of this PR, but can you clear the composite disposable in the onStop/ onDestroy of the activity, ?

@ashishkumar468 ashishkumar468 merged commit a003e97 into commons-app:master Apr 20, 2019
@maskaravivek
Copy link
Member Author

Thanks for merging @ashishkumar468

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Peer review uses XML API to get media categories Contributions DAO saves invalid image URLs
3 participants