Page MenuHomePhabricator

[M] MediaSearch: Unexpected date formatting
Closed, ResolvedPublic

Description

Problem:

  1. https://commons.wikimedia.org/wiki/Special:MediaSearch?quickview=1&q=Battery+of+tests&type=video
  2. Expand result for Cell-02-engineerguy.ogv

Another example with an image:
https://commons.wikimedia.org/wiki/File:Porto_Covo_January_2011-2b.jpg

Expected:

"June 2011"

Actual:

"1 June 2011"

(there is an unspecified date wrongly inferred)

The file information template takes numerous date formats as well as range and approximation templates (such as {{between}}). When possible, these are normalized to produces semantic HTML and machine-readable data that consuming tools should use as-is. In this case, <time class="dtstart" datetime="2011-06">June 2011</time> is produced.

I don't know for sure if that's semantically correct, but if it isn't, then we should help the community update the formatting to work with the standard, or if it is, to update MediaSearch to support the format produced in this case.

The way I noticed this is that the one of the files I edited originally used a non-semantic non-localisable form to specify the month. I changed it to use the machine-readable format to support localisation and such which worked for the file description page, but seems to have confused MediaSearch :)

Event Timeline

Krinkle created this task.Sep 28 2020, 7:23 PM
Restricted Application added a project: Structured-Data-Backlog. · View Herald TranscriptSep 28 2020, 7:23 PM
Restricted Application added a subscriber: Aklapper. · View Herald Transcript
AnneT claimed this task.Oct 21 2020, 4:46 PM
CBogen renamed this task from MediaSearch: Unexpected date formatting to [M] MediaSearch: Unexpected date formatting.Oct 21 2020, 4:49 PM
CBogen removed AnneT as the assignee of this task.
CBogen added a subscriber: AnneT.

Change 637816 had a related patch set uploaded (by Anne Tomasevich; owner: Anne Tomasevich):
[mediawiki/extensions/WikibaseMediaInfo@master] Provide formatted, translated date in QuickView panel

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

Change 637816 merged by jenkins-bot:
[mediawiki/extensions/WikibaseMediaInfo@master] Provide formatted, translated date in QuickView panel

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

Etonkovidova closed this task as Resolved.Nov 25 2020, 10:57 PM
Etonkovidova added a subscriber: Etonkovidova.

Checked in commons wmf.18 - both cases display the same date on both - QuickView and on the File page.

I tried to find some problematic day formats in betalabs to check how they are displayed in QuickView vs File page - something like

+----------------------------+-------------------------------------------+
| img_name                   | Date                                      |
+----------------------------+-------------------------------------------+
| ""Hotelli_Rukajärvi"".jpg  | s:8:"DateTime";s:19:"2018:03:19 17:38:58" |
| -personShown-.jpg          | s:8:"DateTime";s:19:"2020:09:16 19:45:07" |
| ....jpg                    | s:8:"DateTime";s:19:"2018:02:13 03:53:15" |

Turned out that Date is not stored in img_metadata in image table.

However, testing commons betalabs I found couple of cases (I don't think they can be classified as bugs) - for example:

File nameQuickView dateFile page date
QuickView displays only a yearFile:01._sts098-713a-037

Also, I checked some templates - e.g. {{According to Exif data}}, {{Invalid Exif date}}, {{Taken on}}, that are used in the Date field - all seem to be ok.