diff options
-rw-r--r-- | clerk.conf | 10 | ||||
-rwxr-xr-x | clerk_rating_client | 18 |
2 files changed, 17 insertions, 11 deletions
@@ -2,6 +2,9 @@ # MPD_HOST will override this mpd_host=localhost +# music root for rating_client +music_root=/mnt/Music + # define file paths database=PLACEHOLDER/.config/clerk/database.mpk tmux_config=PLACEHOLDER/.config/clerk/clerk.tmux @@ -15,10 +18,9 @@ songs=20 # if mpd drops the connection while updating, reduce this. chunksize=30000 -# rofi theme to use for clerk -rofi_theme=clerk - -jump_query=0 +# write tags to audio files. Needs running clerk_rating_client on machine with audio files +# ratings will always be written to sticker database. +tagging=false [Columns] # width of columns 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"; |