Changeset 29 in mp3-find for trunk/lib/MP3/Find/Filesystem.pm
- Timestamp:
- 05/21/06 05:17:23 (18 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/lib/MP3/Find/Filesystem.pm
r28 r29 9 9 use MP3::Info; 10 10 use Scalar::Util qw(looks_like_number); 11 12 use MP3::Find::Util qw(get_mp3_metadata); 11 13 12 14 eval { … … 97 99 return if $filename =~ $$options{exclude_path}; 98 100 } 99 100 my $mp3 = { 101 FILENAME => $filename, 102 %{ get_mp3tag($filename) || {} }, 103 %{ get_mp3info($filename) || {} }, 104 }; 105 106 if ($CAN_USE_ID3V2 and $$options{use_id3v2}) { 107 # add ID3v2 tag info, if present 108 my $mp3_tags = MP3::Tag->new($filename); 109 unless (defined $mp3_tags) { 110 warn "Can't get MP3::Tag object for $filename\n"; 111 } else { 112 $mp3_tags->get_tags; 113 if (my $id3v2 = $mp3_tags->{ID3v2}) { 114 for my $frame_id (keys %{ $id3v2->get_frame_ids }) { 115 my ($info) = $id3v2->get_frame($frame_id); 116 if (ref $info eq 'HASH') { 117 # use the "Text" value as the value for this frame, if present 118 $mp3->{$frame_id} = $info->{Text} if exists $info->{Text}; 119 } else { 120 $mp3->{$frame_id} = $info; 121 } 122 } 123 } 124 } 125 } 101 102 my $mp3 = get_mp3_metadata({ 103 filename => $filename, 104 use_id3v2 => $options->{use_id3v2}, 105 }); 126 106 127 107 for my $field (keys(%{ $query })) {
Note: See TracChangeset
for help on using the changeset viewer.