Page MenuHomePhabricator

Return extended Commons image metadata in a consistent format
Closed, ResolvedPublic

Description

CI is currently broken because today's POTD credit property contains a JSON object and not a string. The MediaWiki API can return either data type for all extmetadata properties, but currently we only attempt to structure some, and just pass through others.

Once and for all, we should handle extended metadata (extmetadata) items from the MediaWiki API consistently and return them in the following format:

{
  html: <original HTML-formatted text of the value from the MediaWiki API>
  text: <plaintext of the value (HTML-formatted original text, decoded and with tags stripped)>
  lang: <language code representing the language of the value (if provided)>
}

This affects both the featured feed POTD and the /page/media response.

Open question

Currently we use some custom logic to try to structure the artist info in a unique way. Should this also be standardized or should the custom logic be preserved?

Event Timeline

Restricted Application added a subscriber: Aklapper. · View Herald TranscriptJan 15 2019, 3:29 PM
Mholloway triaged this task as High priority.
Mholloway updated the task description. (Show Details)
Mholloway updated the task description. (Show Details)

Change 484588 had a related patch set uploaded (by Mholloway; owner: Mholloway):
[mediawiki/services/mobileapps@master] Media/POTD: Apply standard processing to (almost) all extmetadata values

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

Change 484588 merged by jenkins-bot:
[mediawiki/services/mobileapps@master] Media/POTD: Apply standard processing to (almost) all extmetadata values

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

Jhernandez closed this task as Resolved.Feb 14 2019, 4:09 PM