WordPress.org

Make WordPress Core

Opened 15 months ago

Closed 9 months ago

Last modified 9 months ago

#23926 closed enhancement (fixed)

Use ID3 data for audio and video

Reported by: wonderboymusic Owned by: 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 15 months ago.
23926.2.diff (4.2 KB) - added by wonderboymusic 15 months ago.
23926.3.diff (4.1 KB) - added by wonderboymusic 15 months ago.
23926.4.diff (3.7 KB) - added by wonderboymusic 15 months ago.
23926.5.diff (3.7 KB) - added by wonderboymusic 15 months ago.
23926.6.diff (3.7 KB) - added by wonderboymusic 15 months ago.
23926.7.diff (3.7 KB) - added by wonderboymusic 15 months ago.
23926.8.diff (3.9 KB) - added by wonderboymusic 15 months ago.
23926.9.diff (4.6 KB) - added by johnbillion 15 months ago.
23926.10.diff (4.8 KB) - added by markjaquith 15 months ago.
23926.11.diff (4.8 KB) - added by wonderboymusic 15 months ago.
23926.12.diff (469 bytes) - added by kovshenin 9 months ago.

Download all attachments as: .zip

Change History (22)

wonderboymusic15 months ago

comment:1 wonderboymusic15 months 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 15 months ago by wonderboymusic (previous) (diff)

comment:2 SergeyBiryukov15 months ago

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

wonderboymusic15 months ago

comment:3 wonderboymusic15 months 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

wonderboymusic15 months ago

wonderboymusic15 months ago

comment:4 wonderboymusic15 months ago

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

wonderboymusic15 months ago

wonderboymusic15 months ago

wonderboymusic15 months ago

wonderboymusic15 months ago

johnbillion15 months ago

comment:5 johnbillion15 months 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.

comment:6 SergeyBiryukov15 months 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

markjaquith15 months ago

wonderboymusic15 months ago

comment:7 markjaquith15 months 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.

kovshenin9 months ago

comment:8 kovshenin9 months 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.

comment:9 helen9 months ago

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

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

comment:10 wonderboymusic9 months 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.