diff options
author | Rasmus Steinke <rasi@xssn.at> | 2014-08-26 00:28:30 +0200 |
---|---|---|
committer | Rasmus Steinke <rasi@xssn.at> | 2014-08-26 00:28:30 +0200 |
commit | cd8297655c8523f43b0693e6446b6512804b9d0e (patch) | |
tree | a7aec784b4d287e537a48691784a92217de2c16e /clerk | |
parent | 10e2f99cf956ad36d9901d0b042eb2497a09d985 (diff) | |
download | perl-app-clerk-cd8297655c8523f43b0693e6446b6512804b9d0e.tar.gz perl-app-clerk-cd8297655c8523f43b0693e6446b6512804b9d0e.tar.xz |
...
Diffstat (limited to 'clerk')
-rw-r--r-- | clerk | 36 |
1 files changed, 18 insertions, 18 deletions
@@ -702,29 +702,29 @@ rateAlbum () { exit else cd $HOME/.config/clerk/ratings - if [[ -a "$(mpc current -f %$albumartist%--%date%--%album%).ratings" ]]; then + if [[ -a "$(mpc current -f %$mpd_artist%--%date%--%album%).ratings" ]]; then echo "Ratings file present, using it" else - echo "artist="$(mpc current --format %artist%)"" >> "$(mpc current -f %$albumartist%--%date%--%album%).ratings" - echo "album="$(mpc current --format %album%)"" >> "$(mpc current -f %$albumartist%--%date%--%album%).ratings" - echo "date="$(mpc current --format %date%)"" >> "$(mpc current -f %$albumartist%--%date%--%album%).ratings" - echo "directory="$(dirname "$(mpc current --format %file%)")"" >> "$(mpc current -f %$albumartist%--%date%--%album%).ratings" + 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 $albumartist--%date%--%album%).ratings" + echo "directory="$(dirname "$(mpc current --format %file%)")"" >> "$(mpc current -f %$mpdartist%--%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 %$albumartist%--%date%--%album%).ratings" + sed -i "/album_rating/d" "$(mpc current -f %$mpd_artist%--%date%--%album%).ratings" echo "Album already rated. Changing Rating" fi - echo "album_rating=$ratings/$maxratings" >> "$(mpc current -f %$albumartist%--%date%--%album%).ratings" + echo "album_rating=$ratings/$maxratings" >> "$(mpc current -f %$mpd_artist%--%date%--%album%).ratings" if [[ "$music_dir_access" == "yes" ]]; then cd "$music_path" cd "$(dirname "$(mpc current -f %file%)")" if [[ "$(pwd)" == */"$cd_divider"* ]]; then cd .. fi - cp $HOME/.config/clerk/ratings/"$(mpc current -f %$albumartist%--%date%--%album%).ratings" . + 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 "%$albumartist% - %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 @@ -754,19 +754,19 @@ rateTrack () { cur_artist="$(mpc current -f %artist%)" cur_file="$(basename "$(mpc current -f %file%)")" cd $HOME/.config/clerk/ratings - if [[ -a "$(mpc current -f %$albumartist%--%date%--%album%).ratings" ]]; then + if [[ -a "$(mpc current -f %$mpd_artist%--%date%--%album%).ratings" ]]; then echo "Ratings file present, using it" else - echo "artist="$(mpc current --format %artist%)"" >> "$(mpc current -f %$albumartist%--%date%--%album%).ratings" - echo "album="$(mpc current --format %album%)"" >> "$(mpc current -f %$albumartist%--%date%--%album%).ratings" - echo "date="$(mpc current --format %date%)"" >> "$(mpc current -f %$albumartist%--%date%--%album%).ratings" - echo "directory="$(dirname "$(mpc current --format %file%)")"" >> "$(mpc current -f %$albumartist%--%date%--%album%).ratings" + 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" fi - if grep "$cur_file" "$(mpc current -f %$albumartist%--%date%--%album%).ratings" > /dev/null; then - sed -i "/$cur_file/d" "$(mpc current -f %$albumartist%--%date%--%album%).ratings" + if grep "$cur_file" "$(mpc current -f %$mpd_artist%--%date%--%album%).ratings" > /dev/null; then + sed -i "/$cur_file/d" "$(mpc current -f %$mpd_artist%--%date%--%album%).ratings" echo "File already rated. Changing Rating..." fi - echo "rating=$rating/$track_maxratings $(echo "$cur_file")" >> "$(mpc current -f %$albumartist%--%date%--%album%).ratings" + echo "rating=$rating/$track_maxratings $(echo "$cur_file")" >> "$(mpc current -f %$mpd_artist%--%date%--%album%).ratings" fi if [[ "$music_dir_access" == "yes" ]]; then cd "$music_path" @@ -774,7 +774,7 @@ rateTrack () { if [[ "$(pwd)" == */"$cd_divider"* ]]; then cd .. fi - cp $HOME/.config/clerk/ratings/"$(mpc current -f %$albumartist%--%date%--%album%).ratings" . + 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 "%artist% - %title%") with $rating" |