[wp-trac] [WordPress Trac] #39667: Improve showing metadata in media view
WordPress Trac
noreply at wordpress.org
Mon Sep 10 11:49:56 UTC 2018
#39667: Improve showing metadata in media view
-------------------------------------------------+-------------------------
Reporter: Presskopp | Owner:
| adamsilverstein
Type: enhancement | Status: reopened
Priority: normal | Milestone: 5.0
Component: Media | Version:
Severity: normal | Resolution:
Keywords: has-screenshots has-patch has-unit- | Focuses:
tests | accessibility
-------------------------------------------------+-------------------------
Changes (by birgire):
* status: closed => reopened
* resolution: fixed =>
Comment:
thanks @adamsilverstein
I noticed that for '0:5' and '0:05', the function's output is '5 seconds'
instead of '0 minutes, 5 seconds'.
[attachment:"39667.7.diff"] is a suggestion that:
- Splits the regex into two separate cases: {{{HH:ii:ss}}} and
{{{ii:ss}}}, to simplify it. This capturing part:
{{{(([0-3]?[0-9])|([2][0-3]))}}} was not obvious to me.
- Removes negative duration sign, like {{{'-32:49'}}}, as possibly
prepended by {{{getid3_lib::PlaytimeString()}}}.
- Adds trim to the input duration.
- Uses 'duration' instead of 'filelength' in inline docs and variables. A
suggestion to relate it more with the function's name
{{{human_readable_duration()}}}.
- The input duration '0:5' and '0:05' now outputs as '0 minutes, 5
seconds' instead of '5 seconds'.
- Adds more test cases (e.g. for out of bound).
- Adds inline docs to the dataprovider and the test method.
- Adjusts the name of the test methods.
- Changes {{{@since 5.0}}} to {{{@since 5.0.0}}}.
Regarding a new function's name, are there any guidelines when the
{{{wp_}}} prefix should be used?
--
Ticket URL: <https://core.trac.wordpress.org/ticket/39667#comment:34>
WordPress Trac <https://core.trac.wordpress.org/>
WordPress publishing platform
More information about the wp-trac
mailing list