diff options
author | Rasmus Steinke <rasi@xssn.at> | 2015-05-14 12:19:09 +0200 |
---|---|---|
committer | Rasmus Steinke <rasi@xssn.at> | 2015-05-14 12:19:09 +0200 |
commit | 680a7123cec94eb2038132ce8ca9370667ce1b73 (patch) | |
tree | 8913ed762a977cafca6f5496b98245d9e0dce9b1 | |
parent | 637ac86c419a2f2eeafde468c07278d4dad35995 (diff) | |
download | perl-app-clerk-680a7123cec94eb2038132ce8ca9370667ce1b73.tar.gz perl-app-clerk-680a7123cec94eb2038132ce8ca9370667ce1b73.tar.xz |
fix rating for current playing album
-rwxr-xr-x | clerk | 12 |
1 files changed, 11 insertions, 1 deletions
@@ -774,7 +774,17 @@ rateAlbum () { # track for rating, otherwise use what was delivered in the rate* # variables. if [[ -z "$rateartist" ]]; then - export disc=${disc}; export track=${track}; clerk_helper ratealbum "$(mpc current -f '%albumartist%')" "$(mpc current -f '%album%')" "$(mpc current -f '%date%')" "${rating}" + artist=$(mpc current -f '%artist%') + album=$(mpc current -f '%album%') + date=$(mpc current -f '%date%') + if [[ -n $(mpc find track "1" albumartist "${artist}" album "${album}" date "${date}") ]]; then + track="1" + else + track="01" + fi + disc=$(mpc current -f '%disc%') + export disc=${disc}; export track=${track}; clerk_helper ratealbum "${artist}" "${album}" "${date}" "${rating}" + notify-send "clerk" "rated ${artist} - ${album} with ${rating}" else export disc=${disc}; export track=${track}; clerk_helper ratealbum "${rateartist}" "${ratealbum}" "${ratedate}" "${rating}" notify-send "clerk" "rated ${rateartist} - ${ratealbum} with ${rating}" |