diff options
-rw-r--r-- | clerk | 9 |
1 files changed, 7 insertions, 2 deletions
@@ -2,6 +2,11 @@ shopt -s globstar source $HOME/.config/clerk/config +if [[ -a "$HOME/.config/clerk/ratings" ]]; then + echo "ratings folder exists. using" +else + mkdir "$HOME/.config/clerk/ratings" +fi # create cached album list new_db="$(mpc stats | grep Updated | sed 's/ //g')" @@ -677,7 +682,7 @@ rateAlbum () { exit else cd $HOME/.config/clerk/ratings - if ls "$(mpc current -f %artist%--%date%--%album%).ratings"; then + if [[ -a "$(mpc current -f %artist%--%date%--%album%).ratings" ]]; then echo "Ratings file present, using it" else echo "artist="$(mpc current --format %artist%)"" >> "$(mpc current -f %artist%--%date%--%album%).ratings" @@ -710,7 +715,7 @@ rateTrack () { cur_artist="$(mpc current -f %artist%)" cur_file="$(basename "$(mpc current -f %file%)")" cd $HOME/.config/clerk/ratings - if ls "$(mpc current -f %artist%--%date%--%album%).ratings"; then + if [[ -a "$(mpc current -f %artist%--%date%--%album%).ratings" ]]; then echo "Ratings file present, using it" else echo "artist="$(mpc current --format %artist%)"" >> "$(mpc current -f %artist%--%date%--%album%).ratings" |