Changeset 4 in flacrip for trunk/MusicBrainz.pm


Ignore:
Timestamp:
07/26/12 21:33:59 (12 years ago)
Author:
peter
Message:
  • the MusicBrainz XML parsing returns the actual strings instead of XML::XPath::Literal elements
  • flactrack takes an --all parameter that transcodes all of the tracks for a particular flac file into a directory (directory name defaults to the same as the flac filename, but without the ".flac" extension)
File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/MusicBrainz.pm

    r3 r4  
    4747    my $release_count = $xpath->findvalue('count(//release)'); 
    4848    my ($release) = $xpath->findnodes('//release[1]'); 
    49     $info{RELEASE_MBID} = $xpath->findvalue('@id', $release); 
    50     $info{ALBUM}        = $xpath->findvalue('title', $release); 
    51     $info{ARTIST}       = $xpath->findvalue('artist-credit/name-credit/artist/name', $release); 
     49    $info{RELEASE_MBID} = $xpath->findvalue('@id', $release)->value; 
     50    $info{ALBUM}        = $xpath->findvalue('title', $release)->value; 
     51    $info{ARTIST}       = $xpath->findvalue('artist-credit/name-credit/artist/name', $release)->value; 
    5252 
    5353    # TODO: get release date 
     
    5858        my $prefix = sprintf('TRACK%02d', $tracknum); 
    5959        #$info{"$prefix.MB_TRACKID"} = $xpath->findvalue('@id', $track_node); 
    60         my $recording_mbid = $info{"$prefix.RECORDING_MBID"} = $xpath->findvalue('recording/@id', $track_node); 
    61         $info{"$prefix.TITLE"}          = $xpath->findvalue('recording/title', $track_node); 
    62         $info{"$prefix.ARTIST"}         = $xpath->findvalue('recording/artist-credit/name-credit/artist/name', $track_node) || $info{ARTIST}; 
     60        my $recording_mbid = $info{"$prefix.RECORDING_MBID"} = $xpath->findvalue('recording/@id', $track_node)->value; 
     61        $info{"$prefix.TITLE"}          = $xpath->findvalue('recording/title', $track_node)->value; 
     62        $info{"$prefix.ARTIST"}         = $xpath->findvalue('recording/artist-credit/name-credit/artist/name', $track_node)->value || $info{ARTIST}; 
    6363        $info{TRACKS}[$tracknum]{TITLE} = $info{"$prefix.TITLE"}; 
    6464        $info{TRACKS}[$tracknum]{ARTIST} = $info{"$prefix.ARTIST"}; 
Note: See TracChangeset for help on using the changeset viewer.