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

Restricted Application added a subscriber: Aklapper. · View Herald Transcript
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 subscribed.

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
Screen Shot 2020-11-25 at 2.28.24 PM.png (466×533 px, 162 KB)
Screen Shot 2020-11-25 at 2.22.12 PM.png (188×1 px, 30 KB)

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.