From d04ba906c771e549995606214c0122c12494c3ad Mon Sep 17 00:00:00 2001 From: Rasmus Steinke Date: Sun, 24 Aug 2014 18:50:37 +0200 Subject: changed album ratings too --- clerk | 21 +++++++++++++++------ 1 file changed, 15 insertions(+), 6 deletions(-) (limited to 'clerk') diff --git a/clerk b/clerk index e01af25..3933aff 100644 --- a/clerk +++ b/clerk @@ -616,12 +616,21 @@ rateAlbum () { if [ ratings = "" ]; then exit else - cd "$music_path" - cd "$(dirname "$(mpc current -f %file%)")" - if [[ "$(pwd)" == */"$cd_divider"* ]]; then - cd .. - else echo " " + if [[ "$music_dir_access" == "yes" ]]; then + cd "$music_path" + cd "$music_path" + cd "$(dirname "$(mpc current -f %file%)")" + if [[ "$(pwd)" == */"$cd_divider"* ]]; then + cd .. + else echo " " + fi + rm -f "$(mpc current -f %artist%--%date%--%album%).albumrating" + echo "$ratings/$maxratings" > "$(mpc current -f %artist%--%date%--%album%).albumrating" + echo "$(mpc current -f "%$mpd_artist%")" >> "$(mpc current -f %artist%--%date%--%album%).albumrating" + echo "$(mpc current -f '%album%')" >> "$(mpc current -f %artist%--%date%--%album%).albumrating" + echo "$(mpc current -f '%date%')" >> "$(mpc current -f %artist%--%date%--%album%).albumrating" fi + cd $HOME/.config/clerk/ratings rm -f "$(mpc current -f %artist%--%date%--%album%).albumrating" echo "$ratings/$maxratings" > "$(mpc current -f %artist%--%date%--%album%).albumrating" echo "$(mpc current -f "%$mpd_artist%")" >> "$(mpc current -f %artist%--%date%--%album%).albumrating" @@ -647,7 +656,7 @@ rateTrack () { fi echo "$ratings/$track_maxratings $(echo "$cur_file")" >> "$(mpc current -f %artist%--%date%--%album%).trackratings" fi - cd $HOME/.config/clerk/ratings/flat/tracks + cd $HOME/.config/clerk/ratings if grep "$cur_file" "$(mpc current -f %artist%--%date%--%album%).trackratings" > /dev/null; then sed -i "/$cur_file/d" "$(mpc current -f %artist%--%date%--%album%).trackratings" echo "File already rated. Changing Rating..." -- cgit v1.2.3-24-g4f1b