diff options
author | Rasmus Steinke <rasi@xssn.at> | 2014-08-24 17:46:55 +0200 |
---|---|---|
committer | Rasmus Steinke <rasi@xssn.at> | 2014-08-24 17:46:55 +0200 |
commit | dc1b144b8b82b83837f96f169957fe1ee47324a0 (patch) | |
tree | 490c9de77fead7ee03b3b6e889bcffb7e3dd4cc8 | |
parent | 8ae74dcd10913c7914823c146d613e7500fef3e0 (diff) | |
download | perl-app-clerk-dc1b144b8b82b83837f96f169957fe1ee47324a0.tar.gz perl-app-clerk-dc1b144b8b82b83837f96f169957fe1ee47324a0.tar.xz |
save track ratings in flat file
-rw-r--r-- | clerk | 18 |
1 files changed, 18 insertions, 0 deletions
@@ -632,6 +632,24 @@ rateAlbum () { } rateTrack () { + ratings="$(echo " " | dmenu_t -p "Rating > " | xargs echo)" + if [ ratings = "" ]; then + exit + else + cd "$music_path" + cd "$(dirname "$(mpc current -f %file%)")" + cur_file="$(basename "$(mpc current -f %file%)")" + if grep "$cur_file" track_ratings.txt > /dev/null; then + sed -i "/$cur_file/d" track_ratings.txt + echo "File already rated. Changing Rating..." + fi + echo "$ratings/$track_maxratings $(echo "$cur_file")" >> track_ratings.txt + notify-send "clerk" "Rated $(mpc current -f "%$mpd_artist% - %album%") with $ratings" + fi +} + + +rateTrack2 () { extension=$(mpc current -f %file% | sed 's/.*\.//') ratings="$(echo " " | dmenu_t -p "Rating > " | xargs echo)" if [ ratings = "" ]; then |