Description
Return an imploded field from comments_htmlExtract from structure.txt If you want to merge all available tags (for example, ID3v2 + ID3v1) into one array, you can call getid3_lib::CopyTagsToComments($ThisFileInfo) and you'll then have ['comments'] and ['comments_html'] which are identical to ['tags'] and ['tags_html'] except the array is one dimension shorter (no tag type array keys). For example, artist is: ['tags_html']['id3v1']['artist'][0] or ['comments_html']['artist'][0] Some commonly-used information is found in these locations: File type: ['fileformat'] // ex 'mp3' Song length: ['playtime_string'] // ex '3:45' (minutes:seconds) ['playtime_seconds'] // ex 225.13 (seconds) Overall bitrate: ['bitrate'] // ex 113485.71 (bits-per-second – divide by 1000 for kbps) Audio frequency: ['audio']['sample_rate'] // ex 44100 (Hertz) Artist name: ['comments_html']['artist'][0] // ex 'Elvis' (if CopyTagsToComments() is used – see above) // more than one artist may be present, you may want to use implode: // implode(' & ', ['comments_html']['artist'])
Usage
oik_tunes_get_field( $fileInfo, $field );Parameters
- $fileInfo
- ( mixed ) required –
- $field
- ( mixed ) required –
Returns
voidSource
File name: oik-tunes/admin/oik-tunes.phpLines:
function oik_tunes_get_field( $fileInfo, $field ) { $comments_html = bw_array_get( $fileInfo, "comments_html", null ); if ( $comments_html ) { bw_trace2( $comments_html, "comments_html", true ); $value = bw_array_get( $comments_html, $field, null ); if ( $value ) { $value = implode( ";", $value); } } else { $value = null ; } p( "$field: $value " ); return( $value ); }View on GitHub
Called by
- oik_tunes_analyze_file() – Analyze the file to determine the fields for oik-recording and oik-track and create the oik-track
- oik_tunes_get_artist() – oik tunes get artist
- oik_tunes_get_composers() – Return the composer(s) taking into account additional fields that getID3() does not automatically merge into comments_html
- oik_tunes_get_title() – oik tunes get title
- oik_tunes_get_UFI() – Get a unique file identifier from UniqueFileIdentifier or Album, Year, Track
