Changeset 40 in flacrip for trunk/mbz


Ignore:
Timestamp:
05/08/15 14:48:29 (10 years ago)
Author:
peter
Message:

If given a barcode, get_musicbrainz_info() will attempt to match a release on
the DiscID and the barcode.

  • get_musicbrainz_info() and select_release() take a hashref with discid and barcode keys
  • mbz script takes a --barcode argument; however, if --flac is given, it dtermines the barcode from the BARCODE tag in the FLAC file
  • added a barcode method to the DiscFlacFile class
  • corrected the call to Audio::FLAC::Header::info to a call to tags for the Vorbis tags
  • removed the superfluous getprops script
File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/mbz

    r31 r40  
    1212 
    1313GetOptions( 
    14     'flac=s' =>\my $FLAC_FILE, 
     14    'flac=s'         => \my $FLAC_FILE, 
     15    'barcode=s'      => \my $BARCODE, 
    1516    'get-release-id' => \my $GET_RELEASE_ID, 
    16     'xml' =>\my $GET_XML, 
     17    'xml'            => \my $GET_XML, 
    1718); 
    1819 
    1920my $discid; 
     21my $barcode; 
    2022 
    2123if ($FLAC_FILE) { 
    22     $discid = DiscFlacFile->new({ file => $FLAC_FILE })->discid; 
     24    my $flac_disc = DiscFlacFile->new({ file => $FLAC_FILE }); 
     25    $discid  = $flac_disc->discid; 
     26    $barcode = $flac_disc->barcode; 
    2327} else { 
    24     $discid = shift; 
     28    $discid  = shift; 
     29    $barcode = $BARCODE; 
    2530} 
    2631 
     
    3540 
    3641# otherwise, do the full parsing of the data 
    37 my $info = get_musicbrainz_info($discid); 
     42my $info = get_musicbrainz_info({ 
     43    discid  => $discid, 
     44    barcode => $barcode, 
     45}); 
    3846 
    3947exit unless $info; 
Note: See TracChangeset for help on using the changeset viewer.