sub delete_tags
{
- my($self, @tags)=@_;
+ my($self, $tags, $delvals)=@_;
my $current=$self->tags();
my @current=split(/\s*,\s*/, $current);
+ my @tags=split(/\s*,\s*/, $tags);
my %hash=();
@hash{@current}=();
for my $tag (@tags)
{
delete($hash{$tag}) if(exists($hash{$tag}));
+ if($delvals)
+ {
+ my $base=($tag =~ /(.*?)\//)[0];
+ $base=$tag unless($base);
+ for my $curtag (keys %hash)
+ {
+ delete($hash{$curtag}) if($curtag =~ /^$base\//);
+ }
+ }
}
my @tagsout=sort keys(%hash);
my $genre=join(', ', @tagsout);