This is to implement a service endpoint for returning the daily featured picture from Commons.
Description
Details
Status | Subtype | Assigned | Task | ||
---|---|---|---|---|---|
Resolved | Dbrant | T129076 Implement Feeds in the Android app. | |||
Resolved | • Mholloway | T132814 Tapping the "picture of the day" card should launch Gallery, loaded with previous pictures-of-the-day. | |||
Resolved | • Mholloway | T130962 [Feeds] Implement "picture of the day" card. | |||
Resolved | • bearND | T132340 [EPIC] [Feeds] Implement Content Service endpoint for retrieving specific feed content. | |||
Resolved | • bearND | T132765 [Feeds] Implement Content Service endpoint for "featured picture of the day" |
Event Timeline
It looks like this is currently designed to fail the request if the image caption isn't available in the language for the requested domain.[1] I don't think we should fail in such a case, but instead fall back to English or no caption. What do you think?
[1] It actually doesn't fail in the way it's meant to, which is a bug I found this morning and I'm working on fixing. There's a test to check that a 504 for an unsupported language (French) is thrown, which is only passing because mwapi.checkForQueryPagesInResponse is improperly returning an error with a 200 status code, triggering the successful response branch of the test, which contains no checks, rather than the error branch, which checks for the 504.
Change 297278 had a related patch set uploaded (by Mholloway):
Update Picture of the Day endpoint
I've filed T139314: [Bug] iiextmetadatamultilang does not return all available POTD description translations which is relevant to this endpoint.
All right, a few more words on image description translations, probably mostly for posterity's sake:
My update patch above leverages the iiextmetadatamultilang query paramater to get a set of translations for the image description, but other translations exist that the query doesn't pick up. This is because the query looks to the descriptions template transcluded into the POTD template page to see which languages are available. The visible list on that, page, however, is a transclusion of a list of pages generated with Special:PrefixIndex, e.g.:
https://commons.wikimedia.org/wiki/Special:PrefixIndex/Template:Potd/2016-07-03
If we really wanted to get every possible translation we could probably scrape the titles/lang codes from either the POTD template page or the transcluded Special:PrefixIndex page, but for now, at least for the MVP, I'd favor just relying on iiextmetadatamultilang.
Change 297796 had a related patch set uploaded (by Mholloway):
Picture of the Day card, pt. 1