summaryrefslogtreecommitdiffstats
path: root/clerk
diff options
context:
space:
mode:
authorRasmus Steinke <rasi@xssn.at>2014-08-24 18:50:37 +0200
committerRasmus Steinke <rasi@xssn.at>2014-08-24 18:50:37 +0200
commitd04ba906c771e549995606214c0122c12494c3ad (patch)
treeb27e6d276f629ac279171e080b1c7572fd091c7d /clerk
parentc824a4dc54ce9af0f0ed235832329e9cd007cc47 (diff)
downloadperl-app-clerk-d04ba906c771e549995606214c0122c12494c3ad.tar.gz
perl-app-clerk-d04ba906c771e549995606214c0122c12494c3ad.tar.xz
changed album ratings too
Diffstat (limited to 'clerk')
-rw-r--r--clerk21
1 files changed, 15 insertions, 6 deletions
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..."