Changeset 42 in flacrip
- Timestamp:
- 05/08/15 20:12:40 (10 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/cd2flac
r41 r42 12 12 use Cwd; 13 13 use Audio::FLAC::Header; 14 use MusicBrainz; 14 15 15 16 GetOptions( … … 18 19 'force|f' => \my $FORCE, 19 20 'barcode|b=s' => \my $BARCODE, 21 'properties' => \my $PROPERTIES, 20 22 ); 21 23 … … 39 41 my $tags = $BARCODE ? { BARCODE => $BARCODE } : {}; 40 42 my $ripper = Ripper->new({ device => $CD_DEVICE }); 41 $ripper->rip_to_flac($archive_flac, $tags); 43 my $flac_disc = $ripper->rip_to_flac($archive_flac, $tags); 44 45 if ($PROPERTIES) { 46 my $info = get_musicbrainz_info({ 47 discid => $flac_disc->discid, 48 barcode => $flac_disc->barcode, 49 }); 50 if ($info) { 51 (my $properties_file = $archive_flac) =~ s/\.flac$/.properties/; 52 open my $fh, '>', $properties_file or die "Cannot write $properties_file\n"; 53 print $fh "$_=$$info{$_}\n" foreach sort keys %{ $info }; 54 close $fh; 55 print "Properties written as $properties_file\n"; 56 } 57 } 42 58 43 59 print "Rip saved as $archive_flac\n";
Note: See TracChangeset
for help on using the changeset viewer.