Skip to content

Use image info instead of event logs for getting user uploads #2904

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

Closed
maskaravivek opened this issue Apr 21, 2019 · 4 comments · Fixed by #3566
Closed

Use image info instead of event logs for getting user uploads #2904

maskaravivek opened this issue Apr 21, 2019 · 4 comments · Fixed by #3566

Comments

@maskaravivek
Copy link
Member

maskaravivek commented Apr 21, 2019

Summary:

Currently, the app fetches the user's contributions by:

  • Step 1: querying logevents API (ApacheHttpClientMediaWikiApi:logEvents). This gives the pageid, filename and dateUpdated for user's uploads

  • Step 2: Deleted files(the ones with pageid 0) are skipped and the rest is inserted int the contributions db.

  • Step 3: To show the list of contributions, findThumbnailByFilename is called for each file and the image along with filename is shown.

I propose that we move away from this approach and start consuming imageinfo API for displaying user's contributions.

Eg:

https://commons.wikimedia.org/w/api.php?action=query&format=json&formatversion=2&generator=allimages&gaisort=timestamp&prop=imageinfo&iiprop=url%7Cextmetadata&iiurlwidth=640&iiextmetadatafilter=DateTime%7CCategories%7CGPSLatitude%7CGPSLongitude%7CImageDescription%7CDateTimeOriginal%7CArtist%7CLicenseShortName%7CLicenseUrl&gaiuser=Maskaravivek&gailimit=10

Pros:

Cons:

@maskaravivek
Copy link
Member Author

Most of the code in ContributionsSyncAdapter is from 2013. Fixing the above would help us with #1092

@misaochan @nicolas-raoul it would be great if you could give your opinions on this issue.

@misaochan
Copy link
Member

misaochan commented Apr 21, 2019

@maskaravivek This sounds good to me. The old method is a relic from the legacy app that was implemented before category suggestions etc. I really like the idea of switching to using the same API as that used to generate category suggestions and search - maybe we could even reuse some of the common code if feasible?

Not being able to retrieve deleted images may indeed be a disadvantage, but I don't think we ever reached a consensus on whether we even want that, to begin with.

Pinging @whym and @dbrant for input too.

@maskaravivek
Copy link
Member Author

@ashishkumar468 After our latest refactoring are we still using logEvents to fetch the contributions or has it changed?

@ashishkumar468
Copy link
Collaborator

@maskaravivek We are still using logEvents.

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

Successfully merging a pull request may close this issue.

3 participants