summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorRasmus Steinke <rasi@xssn.at>2015-05-23 09:23:38 +0200
committerRasmus Steinke <rasi@xssn.at>2015-05-23 09:23:38 +0200
commitca9bc25d060dc115a619ce2313a1ab3d9a5046fb (patch)
tree17a0200cf0b68efe7f9df8bd15207fe5b3915a20
parent74921ec503d4a6e76db38eae28b5d4094a6efb61 (diff)
downloadperl-app-clerk-ca9bc25d060dc115a619ce2313a1ab3d9a5046fb.tar.gz
perl-app-clerk-ca9bc25d060dc115a619ce2313a1ab3d9a5046fb.tar.xz
fix instant ratings
-rwxr-xr-xclerk12
1 files changed, 8 insertions, 4 deletions
diff --git a/clerk b/clerk
index 9fa8dcd..76dd2fd 100755
--- a/clerk
+++ b/clerk
@@ -817,8 +817,13 @@ rateTrack () {
# function to instantly rate a track without a submenu. rating is defined on
# commandline
instantRateTrack () {
- export rating=${rating}; clerk_helper ratetrack "${rateartist}" "${ratealbum}" "${ratetrack}" "${ratetitle}" "${rating}"
- notify-send "clerk" "rated $(mpc current) with $(echo ${rating})"
+ rateartist=$(mpc current -f '%artist%')
+ ratetitle=$(mpc current -f '%title%')
+ ratetrack=$(mpc current -f '%track%')
+ ratealbum=$(mpc current -f '%album%')
+ export rating=$1
+ clerk_helper ratetrack "${rateartist}" "${ratealbum}" "${ratetrack}" "${ratetitle}" "${rating}"
+ notify-send "clerk" "rated ${rateartist} - ${ratetitle} with $(echo ${rating})"
}
# load rated albums with minimum rating of xx
@@ -1634,8 +1639,7 @@ while :; do
echo "Missing argument for --rate instant"
echo "Please define rating between 1-10"
else
- export rating="$3"
- instantRateTrack
+ instantRateTrack $3
fi
elif [[ $2 == load ]]; then
mpc clear && mpc sticker "" find rating | grep -E "rating=6|rating=7|rating=8|rating=9|rating=10" | awk -F ':' '{print $1}' | $shuf -n $value | mpc add && mpc play