Skip to content

Bug fix issue #1839, changes #1845

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

Conversation

ashishkumar468
Copy link
Collaborator

  • Extracted out PageTitle object's member varaible, displayText in a variable in findTemplate() in MediaDataExtractor
  • added null checks for the same varaible [Lets be safe side]
  • replaced equals with contains, ie. displayText.contains(title), so that uploads from multiple sources which have different formats still show up coordinates which was not being shown earlier

Coordinates not showing up in "My Recent Uploads" picture

Fixes #{GitHub issue number #1839 and title Coordinates not showing up in "My Recent Uploads" picture }

Description

Fixes #{#1839}

The getTemplate() function in MediaDataExtractor used to extract data by searching for the elements to be shown in the ui. One of which is location. Now location for images uploaded from web and mobile had different formats for an example see
One uploaded from the app:
{{Location|12.958117388888889|77.6440805}}
One uploaded from elsewhere:
{{Location dec|47.99081|7.845416|heading:255.9}}

Clearly an exact string match for string Location would show null results for the later. So added contains instead of equals to solve the same.

Tests performed (required)

Tested on {27 & Samsung s7}, with {ProdDebug}.

Screenshots showing what changed (optional)

device-2018-08-21-232201

{Only for user interface changes, otherwise remove this section. See how to take a screenshot}

Note: Please ensure that you have read CONTRIBUTING.md if this is your first pull request.

* Extracted out PageTitle object's member varaible, displayText in a variable in findTemplate() in MediaDataExtractor
* added null checks for the same varaible [Lets be safe side]
* replaced equals with contains, ie. displayText.contains(title), so that uploads from multiple sources which have different formats still show up coordinates which was not being shown earlier
@codecov-io
Copy link

Codecov Report

Merging #1845 into master will decrease coverage by <.01%.
The diff coverage is 0%.

Impacted file tree graph

@@            Coverage Diff            @@
##           master   #1845      +/-   ##
=========================================
- Coverage    3.61%   3.61%   -0.01%     
=========================================
  Files         192     192              
  Lines        9837    9838       +1     
  Branches      871     871              
=========================================
  Hits          356     356              
- Misses       9455    9456       +1     
  Partials       26      26
Impacted Files Coverage Δ
...n/java/fr/free/nrw/commons/MediaDataExtractor.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 4ea7229...b190744. Read the comment docs.

@nicolas-raoul
Copy link
Member

Thanks!
What tests did you perform?
Would you mind using Explore to open to metadata details of the first 50 pictures that appear, to make sure there is no crash? It is easy to do by swiping left 50 times.

@ashishkumar468
Copy link
Collaborator Author

@nicolas-raoul Sure I will, and

What tests did you perform?

,

Searched for few images for which the coordinates was there on web but not on the app, and they pretty well displayed the coordinates

@ashishkumar468
Copy link
Collaborator Author

@nicolas-raoul As you had asked, went through first 50 images in Explore, the app is stable, no crashes or issues with the coordinates

@maskaravivek
Copy link
Member

Looks good to me. Merging it. Thanks @ashishkumar468

@maskaravivek maskaravivek merged commit e458421 into commons-app:master Aug 22, 2018
ilgazer pushed a commit to ilgazer/apps-android-commons that referenced this pull request Sep 9, 2018
* Extracted out PageTitle object's member varaible, displayText in a variable in findTemplate() in MediaDataExtractor
* added null checks for the same varaible [Lets be safe side]
* replaced equals with contains, ie. displayText.contains(title), so that uploads from multiple sources which have different formats still show up coordinates which was not being shown earlier
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.

4 participants