Page MenuHomePhabricator

Missing file size in long file descriptions generated by TMH
Closed, ResolvedPublic

Description

Unlike messages file-info, file-info-size and file-info-size-pages, file size is missing in long file descriptions generated by TMH. Compare:
https://commons.wikimedia.org/wiki/File:NDL1875188_%E6%94%AF%E9%82%A3%E5%BB%BA%E7%AF%89%E7%B4%B0%E9%83%A8%E9%9B%86.pdf?uselang=en

10,329 × 6,943 pixels, file size: 198.66 MB, MIME type: application/pdf, 104 pages

and https://commons.wikimedia.org/wiki/File:%E4%B8%80%E8%B4%AF%E5%AE%B3%E4%BA%BA%E9%81%93_1952.webm?uselang=en

WebM audio/video file, VP9/Opus, length 1 h 46 min 44 s, 1,279 × 974 pixels, 2.73 Mbps overall

The file size should be provided in these long descriptions.

Event Timeline

Change 942768 had a related patch set uploaded (by 沈澄心; author: 沈澄心):

[mediawiki/extensions/TimedMediaHandler@master] Show file size and replace $wgLang in getLongDesc()

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

Test wiki created on Patch demo by 沈澄心 using patch(es) linked to this task:
https://patchdemo.wmflabs.org/wikis/5ba1435fbb/w

https://patchdemo.wmflabs.org/wikis/5ba1435fbb/wiki/File:%E4%B8%80%E8%B4%AF%E5%AE%B3%E4%BA%BA%E9%81%93_1952.webm:

WebM audio/video file, VP9/Opus, length 1 h 46 min 44 s, 1,279 × 974 pixels, 2.73 Mbps overall, file size: 2.04 GB

I'm surprised they didn't include file size. There doesn't seem to be any reason to omit it.

I thought that maybe file size was added to the core MediaWiki messages at some point and TimedMediaHandler was never updated, but that's not the case:

Change 942768 merged by jenkins-bot:

[mediawiki/extensions/TimedMediaHandler@master] Show file size in getLongDesc()

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

matmarex assigned this task to Dringsim.

Test wiki on Patch demo by 沈澄心 using patch(es) linked to this task was deleted:

https://patchdemo.wmflabs.org/wikis/5ba1435fbb/w/