Page MenuHomePhabricator

[BUG] Media endpoint doesn't returned structured captions for non-English wikis
Closed, ResolvedPublicBUG REPORT

Description

The media end-point is not returning any structured captions, even when they exist in other wikis
Tried wikis: hi, kn, fr

Expected: same structured captions language to caption mapping is returned for a particular image, on any wiki.

Actual: not returning structured captions on non-english wikis

Example: Bill Joel image
We can see structured captions for both "en" and "kn" here :
https://en.wikipedia.org/api/rest_v1/page/media/Billy_Joel

But same image in "kn" doesn't return structured captions
https://kn.wikipedia.org/api/rest_v1/page/media/ಬಿಲ್ಲೀ_ಜೋಯಲ್

Event Timeline

Restricted Application changed the subtype of this task from "Task" to "Bug Report". · View Herald TranscriptJul 23 2019, 5:35 PM
Restricted Application added a subscriber: Aklapper. · View Herald Transcript

@Sharvaniharan the media-list endpoint should be used instead of the media endpoint as a result of the caching issue discovered in T225443. The structured captions would then be requested directly from commons.

@JoeWalsh I don't see structured captions in the response. For example for the file File:Billy_Joel_Shankbone_NYC_2009

I can see structured captions here: https://en.wikipedia.org/api/rest_v1/page/media/Billy_Joel

but not here:

https://en.wikipedia.org/api/rest_v1/page/media-list/Billy_Joel

@Sharvaniharan correct - the structured captions would need to be requested directly from commons using wbgetentities, for example /w/api.php?action=wbgetentities&sites=commonswiki&titles=File%3ABilly_Joel_Shankbone_NYC_2009.jpg. Other metadata would be requested using action=query&prop=imageinfo on the article's wiki, as with the existing getImageExtMetadata in the Android app

Could you please associate an active code repository project tag with this task so others can find this task when searching for tasks under that code project? Thanks.

Change 525159 had a related patch set uploaded (by Joewalsh; owner: Joewalsh):
[mediawiki/services/mobileapps@master] Use normalized File: titles for commons

https://gerrit.wikimedia.org/r/525159

Change 525159 merged by jenkins-bot:
[mediawiki/services/mobileapps@master] Use normalized File: titles for commons

https://gerrit.wikimedia.org/r/525159

@JoeWalsh can you ping the Android slack channel when this is deployed? Thanks!

Mholloway assigned this task to JoeWalsh.