summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorRasmus Steinke <rasi@xssn.at>2014-10-18 20:19:10 +0200
committerRasmus Steinke <rasi@xssn.at>2014-10-18 20:19:10 +0200
commit2eebfd2bb5a78f583c59b86307c3b1f9b4a98e87 (patch)
tree20e8cbc3ffb86b57ec0d5d6ad6dbe4a422bed753
parent8eb8b03b8657314d0d62541c4cbc55b2eca99681 (diff)
downloadperl-app-clerk-2eebfd2bb5a78f583c59b86307c3b1f9b4a98e87.tar.gz
perl-app-clerk-2eebfd2bb5a78f583c59b86307c3b1f9b4a98e87.tar.xz
rating tracks exits
-rwxr-xr-xclerk29
1 files changed, 26 insertions, 3 deletions
diff --git a/clerk b/clerk
index d8bf56b..0190e83 100755
--- a/clerk
+++ b/clerk
@@ -76,9 +76,9 @@ playbackPrompt () {
lastFM () {
# Some Variables to clean up the code
-mpds_check="$(ssh $ssh_host -q -t 'bash -c "pgrep mpdscribble"')"
- if ((ssh_lastfm)); then
+ if [[ $ssh_lastfm == 1 ]]; then
+ mpds_check="$(ssh $ssh_host -q -t 'bash -c "pgrep mpdscribble"')"
if [ -n "$mpds_check" ];
then
ssh $ssh_host -q -t 'bash -c "killall mpdscribble"' && notify-send "MPD" "LastFM Scrobbling Disabled"
@@ -95,6 +95,26 @@ mpds_check="$(ssh $ssh_host -q -t 'bash -c "pgrep mpdscribble"')"
fi
}
+lastFMCheck () {
+# Some Variables to clean up the code
+
+ if ((ssh_lastfm)); then
+ mpds_check="$(ssh $ssh_host -q -t 'bash -c "pgrep mpdscribble"')"
+ if [ -n "$mpds_check" ]; then
+ echo "lastfm: off"
+ else
+ echo "lastfm: on"
+ fi
+ else
+ if pgrep mpdscribble
+ then
+ echo "lastfm: on"
+ else
+ echo "lastfm: off"
+ fi
+ fi
+}
+
currentPrompt () {
menu=("0 Return to Main Menu"
@@ -621,7 +641,6 @@ rateTrack () {
sed -i "/$(mpc current -f '%title%')/d" track.ratings
echo "${rating}\\$(mpc current -f "%artist%\%track%\%title%\%date%\%album%")" >> track.ratings
fi
- ratingPrompt
fi
}
@@ -1365,6 +1384,10 @@ elif [[ "$1" == "-playlists" ]]; then
elif [[ "$1" == "-rcurrent" ]]; then
export rating="$2"
instantRateTrack
+elif [[ "$1" == "-scrobbling" ]]; then
+ lastFM
+elif [[ "$1" == "-checklfm" ]]; then
+ lastFMCheck
else
dplayPrompt
fi