summaryrefslogtreecommitdiffstats
path: root/clerk
diff options
context:
space:
mode:
Diffstat (limited to 'clerk')
-rw-r--r--clerk9
1 files changed, 7 insertions, 2 deletions
diff --git a/clerk b/clerk
index 3b8578f..ae998db 100644
--- a/clerk
+++ b/clerk
@@ -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"