Make WordPress Core

Opened 12 years ago

Closed 11 years ago

Last modified 11 years ago

#23926 closed enhancement (fixed)

Use ID3 data for audio and video

Reported by: wonderboymusic's profile wonderboymusic Owned by: markjaquith's profile markjaquith
Milestone: 3.6 Priority: normal
Severity: normal Version: 3.6
Component: Media Keywords: has-patch
Focuses: Cc:

Description

Since we are parsing ID3 tag data into attachment metadata, we should use it to pre-fill audio / video data in the media library. We should also display some of the data on the attachment edit page.

Attachments (12)

23926.diff (4.1 KB) - added by wonderboymusic 12 years ago.
23926.2.diff (4.2 KB) - added by wonderboymusic 12 years ago.
23926.3.diff (4.1 KB) - added by wonderboymusic 12 years ago.
23926.4.diff (3.7 KB) - added by wonderboymusic 12 years ago.
23926.5.diff (3.7 KB) - added by wonderboymusic 12 years ago.
23926.6.diff (3.7 KB) - added by wonderboymusic 12 years ago.
23926.7.diff (3.7 KB) - added by wonderboymusic 12 years ago.
23926.8.diff (3.9 KB) - added by wonderboymusic 12 years ago.
23926.9.diff (4.6 KB) - added by johnbillion 12 years ago.
23926.10.diff (4.8 KB) - added by markjaquith 12 years ago.
23926.11.diff (4.8 KB) - added by wonderboymusic 12 years ago.
23926.12.diff (469 bytes) - added by kovshenin 11 years ago.

Download all attachments as: .zip

Change History (22)

#1 @wonderboymusic
12 years ago

Here is a generic video that has some extra data: http://cl.ly/image/0P3K1j47130z

Here is an audio file with more data: http://cl.ly/image/3P3j290u3D21

The patch also contains code that constrains video dimensions on the edit attachment page so a large video doesn't explode all over the page

Last edited 12 years ago by wonderboymusic (previous) (diff)

#2 @SergeyBiryukov
12 years ago

In 23926.diff, i18n is missing in lines 240 to 248.

#3 @wonderboymusic
12 years ago

23926.2.diff adds more i18n - I also need to add video handling, I need to upload a real mp4 from iTunes to see what is showable

#4 @wonderboymusic
12 years ago

23926.4.diff​ is DRY'd - video ID3 doesn't return much printable data, it doesn't need to pre-fill on upload

@johnbillion
12 years ago

#5 @johnbillion
12 years ago

23926.9.diff is wonderboymusic's patch reformatted with some better i18n. It treats each possible variation of the title, album and artist as a whole, rather than concatenating bits together.

I've also added an extra check to the track number because I noticed some of my MP3s have a track number of just "x" instead of "x/y". Added number_format_i18n() in there too for super maximum i18n.

#6 @SergeyBiryukov
12 years ago

_x( '“%1$s” by %2$s.', 'Audio track title by artist name' )

As noted by nacin, this is not the right use of context.

It's only needed for ambiguous strings with different context. See '%1$s %2$s' in get_calendar() and wp_insert_user() for example:
http://core.trac.wordpress.org/browser/tags/3.5.1/wp-includes/general-template.php#L1145
http://core.trac.wordpress.org/browser/tags/3.5.1/wp-includes/user.php#L1346

A translator's comment should be used instead, like in feed_links_extra():
http://core.trac.wordpress.org/browser/tags/3.5.1/wp-includes/general-template.php#L1621

#7 @markjaquith
12 years ago

  • Owner set to markjaquith
  • Resolution set to fixed
  • Status changed from new to closed

In 23979:

Use ID3 data for audio and video

fixes #23926. props wonderboymusic, SergeyBiryukov, johnbillion.

@kovshenin
11 years ago

#8 @kovshenin
11 years ago

  • Resolution fixed deleted
  • Status changed from closed to reopened

The regex in r23979 '#^audio|video#' is too permissive. It seems as if it was intended to match audio* and video*, but it actually matches application/octet-stream+video just fine. Not a big deal in this particular situation, but .12.diff takes care of that.

#9 @helen
11 years ago

  • Resolution set to fixed
  • Status changed from reopened to closed

Ticket was closed on a completed milestone - please open a new one.

#10 @wonderboymusic
11 years ago

In 25727:

Use parens to ensure that RegEx OR matches the front when determining that mime-type matches audio|video in attachment_submitbox_metadata().

Props kovshenin.
See #23926.

Note: See TracTickets for help on using tickets.