Skip to content

Commit 1bae29b

Browse files
committed
fix albumrating too
1 parent c4141db commit 1bae29b

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

clerk_rating_client

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -111,13 +111,15 @@ sub tag_mp3s {
111111
sub tag_oggs {
112112
my ($uri, $mode, $rating, $artist, $albumartist, $title, $album) = @_;
113113
print "$uri\n$rating\n";
114-
my @values = grep !/^RATING=?$/, `vorbiscomment "${music_root}/${uri}"`;
114+
my @values = `vorbiscomment "${music_root}/${uri}"`;
115115
if ($mode eq "rating") {
116+
@values = grep !/^RATING=?$/, @values;
116117
print ":: tagging track \"${title}\" by \"${artist}\" with rating of \"${rating}\"\n";
117118
push (@values, "RATING=$rating");
118119
} elsif ($mode eq "albumrating") {
120+
@values = grep !/^ALBUMRATING=?$/, @values;
119121
print ":: tagging track \"${title}\" by \"${albumartist}\" with albumrating of \"${rating}\"\n";
120-
@values = map {/^ALBUMRATING/? "ALBUMRATING=$rating" : $_ } @values;
122+
push (@values, "ALBUMRATING=$rating");
121123
}
122124
system('vorbiscomment', '-c', '/dev/null', '-w', "${music_root}/${uri}");
123125
for my $vorbiscomment (@values) {

0 commit comments

Comments
 (0)