id3fs-tag -V: per-dir summaries
[id3fs.git] / lib / ID3FS / AudioFile / Mp3.pm
index 7cd15b9..f060dc9 100644 (file)
@@ -18,6 +18,7 @@ package ID3FS::AudioFile::Mp3;
 
 use strict;
 use warnings;
+use ID3FS::AudioFile;
 use MP3::Tag;
 use MP3::Info;
 
@@ -145,7 +146,7 @@ sub add_tags
     my($self, @tags)=@_;
     my $existing=$self->tags();
     my @existing=split(/\s*,\s*/, $existing) if($existing);
-    my @merged=$self->uniq(@tags, @existing);
+    my @merged=ID3FS::AudioFile::uniq(@tags, @existing);
     my $genre=join(', ', @merged);
     return($self->set("genre", $genre));
 }
@@ -206,7 +207,8 @@ sub delete_tags
 {
     my($self, $tags, $delvals)=@_;
     my $current=$self->tags();
-    my @current=split(/\s*,\s*/, $current);
+    my @current=();
+    @current=split(/\s*,\s*/, $current) if($current);
     my @tags=split(/\s*,\s*/, $tags);
     my %hash=();
     @hash{@current}=();
@@ -301,13 +303,6 @@ sub delete
     }
 }
 
-sub uniq
-{
-    my ($self, @things)=@_;
-    my %hash=();
-    @hash{@things}=();
-    return(sort keys(%hash));
-}
 
 sub channels
 {