Changeset 35 in flacrip for trunk


Ignore:
Timestamp:
03/25/15 18:59:54 (10 years ago)
Author:
peter
Message:

applymeta:

  • if no track numbers are given, assume all tracks
  • don't write an ID3v2 TPE2 frame (this may have been causing problems with ID3v1-only reading software)
File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/applymeta

    r20 r35  
    2929 
    3030my @track_numbers; 
    31 foreach (split /,/, $TRACKS) { 
    32     if (/^(\d+)$/) { 
    33         push @track_numbers, $1; 
    34     } elsif (/^(\d+)-(\d+)$/) { 
    35         push @track_numbers, ($1 .. $2); 
    36     } elsif (/^-(\d+)$/) { 
    37         push @track_numbers, (1 .. $1); 
    38     } elsif (/^(\d+)-$/) { 
    39         push @track_numbers, ($1 .. $track_count); 
     31if ($TRACKS) { 
     32    foreach (split /,/, $TRACKS) { 
     33        if (/^(\d+)$/) { 
     34            push @track_numbers, $1; 
     35        } elsif (/^(\d+)-(\d+)$/) { 
     36            push @track_numbers, ($1 .. $2); 
     37        } elsif (/^-(\d+)$/) { 
     38            push @track_numbers, (1 .. $1); 
     39        } elsif (/^(\d+)-$/) { 
     40            push @track_numbers, ($1 .. $track_count); 
     41        } 
    4042    } 
     43} else { 
     44    @track_numbers = (1 .. $track_count); 
    4145} 
    4246 
     
    6064    $mp3->year_set($year) if $year; 
    6165    $mp3->track_set($i); 
    62     $mp3->select_id3v2_frame_by_descr('TPE2', $metadata->{ALBUMARTIST}) if $metadata->{ALBUMARTIST}; 
    6366    $mp3->update_tags; 
    6467    printf "    Apply to %s\n", $audio_file; 
Note: See TracChangeset for help on using the changeset viewer.