summaryrefslogtreecommitdiffstats
path: root/clerk_rating_client
diff options
context:
space:
mode:
Diffstat (limited to 'clerk_rating_client')
-rwxr-xr-xclerk_rating_client18
1 files changed, 11 insertions, 7 deletions
diff --git a/clerk_rating_client b/clerk_rating_client
index b05bc2b..bb63a3a 100755
--- a/clerk_rating_client
+++ b/clerk_rating_client
@@ -62,21 +62,25 @@ sub track_rating {
my $title = $song_tags[0]->{Title};
my $album = $song_tags[0]->{Album};
if ($uri =~ /.*.flac$/) {
- if ($mode eq "RATING") {
+ if ($mode eq "rating") {
print ":: tagging track \"${title}\" by \"${artist}\" with rating of \"${rating}\"\n";
- } elsif ($mode eq "ALBUMRATING") {
+ system('metaflac', '--remove-tag=RATING', "${music_root}/${uri}");
+ system('metaflac', "--set-tag=RATING=${rating}", "${music_root}/${uri}");
+ } elsif ($mode eq "albumrating") {
print ":: tagging track \"${title}\" by \"${albumartist}\" with albumrating of \"${rating}\"\n";
+ system('metaflac', '--remove-tag=ALBUMRATING', "${music_root}/${uri}");
+ system('metaflac', "--set-tag=ALBUMRATING=${rating}", "${music_root}/${uri}");
}
- system('metaflac', '--remove-tag=RATING', "${music_root}/${uri}");
- system('metaflac', "--set-tag=${mode}=${rating}", "${music_root}/${uri}");
}
elsif ($uri =~ /.*.mp3$/) {
- if ($mode eq "RATING") {
+ if ($mode eq "rating") {
print ":: tagging track \"${title}\" by \"${artist}\" with rating of \"${rating}\"\n";
- } elsif ($mode eq "ALBUMRATING") {
+ system('mid3v2', "--TXXX", "RATING:${rating}", "${music_root}/${uri}");
+
+ } elsif ($mode eq "albumrating") {
print ":: tagging track \"${title}\" by \"${albumartist}\" with albumrating of \"${rating}\"\n";
+ system('mid3v2', "--TXXX", "ALBUMRATING:${rating}", "${music_root}/${uri}");
}
- system('mid3v2', "--TXXX", "${mode}:${rating}", "${music_root}/${uri}");
}
elsif ($uri =~ /.*.ogg$/) {
print "!! OGG files not supported, yet\n";