[wp-trac] [WordPress Trac] #39667: Improve showing metadata in media view

WordPress Trac noreply at wordpress.org
Sat Sep 8 12:43:10 UTC 2018


#39667: Improve showing metadata in media view
-------------------------------------------------+-------------------------
 Reporter:  Presskopp                            |       Owner:
                                                 |  adamsilverstein
     Type:  enhancement                          |      Status:  closed
 Priority:  normal                               |   Milestone:  5.0
Component:  Media                                |     Version:
 Severity:  normal                               |  Resolution:  fixed
 Keywords:  has-screenshots has-patch has-unit-  |     Focuses:
  tests                                          |  accessibility
-------------------------------------------------+-------------------------

Comment (by birgire):

 +1 for these changes.

 Just some late afterthoughts:

 Regarding the {{{human_readable_duration()}}}, I was wondering about the
 out of bound values, negative playstrings and if 0-parts should be
 generated.

 It seems that the maximum duration supported by that function is
 {{{39:59:59}}}. It comes from the reg-ex. I doubt it will be ever passed
 in reality, but maybe we should document it in the functions description?

 So for documentation purpose, it might be helpful to have the out of bound
 behavior listed in the data provider e.g. as:

 {{{
 array( '39:59:59', '39 hours, 59 minutes, 59 seconds' ), // Maximum
 support for HH:ii:ss.
 array( '59:61', false ), // Out of bound seconds for ii:ss.
 array( '61:59', false ),  // Out of bound seconds for ii:ss.
 array( '3:59:61', false ), // Out of bound minutes for HH:ii:ss.
 array( '3:61:59', false ), // Out of bound minutes for HH:ii:ss.
 array( '40:00:00', false ), // Out of bound hours for HH:ii:ss.
 }}}

 I looked at {{{getid3_lib::PlaytimeString()}}} but didn't see any explicit
 hour limitations there:

 https://core.trac.wordpress.org/browser/tags/4.9.8/src//wp-
 includes/ID3/getid3.lib.php#L461

 It also seems to be able to generate negative playstrings, should that be
 considered here?

 I first thought the PHP function {{{data_parse()}}} could be useful here,
 but it has some differences, like it understands {{{12:34}}} as
 {{{HH:ii}}}, but not as {{{ii:ss}}}. So I think it might just complicate
 things more using that function :-)

 Another thing that comes to mind, is that if 0-parts would be needed in
 the generated string or if it should be an option?

 Example {{{00:00:01}}} is generated as {{{0 hours, 0 minutes, 1 second}}}
 but would it make sense to generate only {{{1 second}}}? But then it's not
 obvious what string {{{00:00:00}}} should generate :-)

 If I remember correctly {{{human_time_diff()}}} doesn't display 0-parts?
 Or maybe we shouldn't do such a comparison here, as it's not exactly the
 same kind of data.

-- 
Ticket URL: <https://core.trac.wordpress.org/ticket/39667#comment:32>
WordPress Trac <https://core.trac.wordpress.org/>
WordPress publishing platform


More information about the wp-trac mailing list