diff options
author | Rasmus Steinke <rasi@xssn.at> | 2014-08-24 18:50:37 +0200 |
---|---|---|
committer | Rasmus Steinke <rasi@xssn.at> | 2014-08-24 18:50:37 +0200 |
commit | d04ba906c771e549995606214c0122c12494c3ad (patch) | |
tree | b27e6d276f629ac279171e080b1c7572fd091c7d | |
parent | c824a4dc54ce9af0f0ed235832329e9cd007cc47 (diff) | |
download | perl-app-clerk-d04ba906c771e549995606214c0122c12494c3ad.tar.gz perl-app-clerk-d04ba906c771e549995606214c0122c12494c3ad.tar.xz |
changed album ratings too
-rw-r--r-- | clerk | 21 |
1 files changed, 15 insertions, 6 deletions
@@ -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..." |