Changeset 14 in mp3-find
- Timestamp:
- 03/27/06 19:34:43 (19 years ago)
- Location:
- trunk
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/Changes
r13 r14 4 4 - added "exclude_path" option to filesystem backend 5 5 - added "sync_db" method to the DB backend 6 - added support for searching by ID3v2 tag (using MP3::Tag) 6 7 7 8 0.02 1 Feb 2006 -
trunk/lib/MP3/Find/Filesystem.pm
r12 r14 76 76 %{ get_mp3info($filename) || {} }, 77 77 }; 78 79 if ($$options{use_id3v2}) { 80 require MP3::Tag; 81 # add ID3v2 tag info, if present 82 my $mp3_tags = MP3::Tag->new($filename); 83 $mp3_tags->get_tags; 84 if (my $id3v2 = $mp3_tags->{ID3v2}) { 85 for my $frame_id (keys %{ $id3v2->get_frame_ids }) { 86 my ($info) = $id3v2->get_frame($frame_id); 87 if (ref $info eq 'HASH') { 88 #TODO: how should we handle these? 89 } else { 90 $mp3->{$frame_id} = $info; 91 } 92 } 93 } 94 } 95 78 96 for my $field (keys(%{ $query })) { 79 97 my $value = $mp3->{uc($field)}; … … 110 128 L<File::Find>, L<MP3::Info>, L<Scalar::Util> 111 129 130 L<MP3::Tag> is also needed if you want to search using ID3v2 tags. 131 112 132 =head1 DESCRIPTION 113 133 … … 123 143 Scalar or arrayref; any file whose name matches any of these paths 124 144 will be skipped. 145 146 =item C<use_id3v2> 147 148 Boolean, defaults to false. If set to true, MP3::Find::Filesystem will 149 use L<MP3::Tag> to get the ID3v2 tag for each file. You can then search 150 for files by their ID3v2 data, using the four-character frame names. 151 This isn't very useful if you are just search by artist or title, but if, 152 for example, you have made use of the C<TOPE> ("Orignal Performer") frame, 153 you could search for all the cover songs in your collection: 154 155 $finder->find_mp3s(query => { tope => '.' }); 156 157 As with the basic query keys, ID3v2 query keys are converted to uppercase 158 internally. 159 160 =back 125 161 126 162 =head1 SEE ALSO
Note: See TracChangeset
for help on using the changeset viewer.