summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorRasmus Steinke <rasi@xssn.at>2015-05-14 12:19:09 +0200
committerRasmus Steinke <rasi@xssn.at>2015-05-14 12:19:09 +0200
commit680a7123cec94eb2038132ce8ca9370667ce1b73 (patch)
tree8913ed762a977cafca6f5496b98245d9e0dce9b1
parent637ac86c419a2f2eeafde468c07278d4dad35995 (diff)
downloadperl-app-clerk-680a7123cec94eb2038132ce8ca9370667ce1b73.tar.gz
perl-app-clerk-680a7123cec94eb2038132ce8ca9370667ce1b73.tar.xz
fix rating for current playing album
-rwxr-xr-xclerk12
1 files changed, 11 insertions, 1 deletions
diff --git a/clerk b/clerk
index 511fb79..1ca0658 100755
--- a/clerk
+++ b/clerk
@@ -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}"