From 6e31123282a27215016b6a8a4665e14ba229a416 Mon Sep 17 00:00:00 2001 From: Rasmus Steinke Date: Tue, 26 Aug 2014 03:35:15 +0200 Subject: small fixes --- clerk | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'clerk') diff --git a/clerk b/clerk index f4b228a..76e660b 100644 --- a/clerk +++ b/clerk @@ -687,10 +687,10 @@ rateAlbum () { elif [[ "$mpd_artist" == "artist" ]]; then albumartist="$(mpc current -f %artist%)" fi - artist="$(mpc format -f %artist%)" + artist="$(mpc current -f %artist%)" album="$(mpc current -f %album%)" date="$(mpc current -f %date%)" - directory="$(dirname "$(mpc current -f %file%)")" + directory="$(dirname "$(mpc current -f %file%)" | sed -e "s/\/"$cd_divider".*$//g")" rating="$(seq $maxratings | dmenu_t -p "Select Rating: > ")" date=$(escapeSql "$date") artist=$(escapeSql "$artist") @@ -708,7 +708,7 @@ rateAlbum () { echo "artist="$(mpc current --format %artist%)"" >> "$(mpc current -f %$mpd_artist%--%date%--%album%).ratings" echo "album="$(mpc current --format %album%)"" >> "$(mpc current -f %$mpd_artist%--%date%--%album%).ratings" echo "date="$(mpc current --format %date%)"" >> "$(mpc current -f %$mpd_artist%--%date%--%album%).ratings" - echo "directory="$(dirname "$(mpc current --format %file%)")"" >> "$(mpc current -f %$mpd_artist%--%date%--%album%).ratings" + echo "directory="$(echo "$directory")"" >> "$(mpc current -f %$mpd_artist%--%date%--%album%).ratings" fi if grep "album_rating=" "$(mpc current -f %artist%--%date%--%album%).ratings" > /dev/null; then sed -i "/album_rating/d" "$(mpc current -f %$mpd_artist%--%date%--%album%).ratings" @@ -724,7 +724,7 @@ rateAlbum () { cp $HOME/.config/clerk/ratings/"$(mpc current -f %$mpd_artist%--%date%--%album%).ratings" . fi cd $HOME/.config/clerk/ratings - notify-send "clerk" "Rated $(mpc current -f "%$mpd_artist% - %album%") with $rating" + notify-send "clerk" "Rated $(mpc current -f %$mpd_artist% - %album%) with $rating" sqlite3 ../ratings.db "insert or replace into albums (date, artist, album, directory, rating) values ('$date', '$albumartist', '$album', '$directory', '$rating')" fi ratingPrompt -- cgit v1.2.3-24-g4f1b