summaryrefslogtreecommitdiffstats
path: root/clerk
diff options
context:
space:
mode:
authorRasmus Steinke <rasi@xssn.at>2014-08-25 00:54:07 +0200
committerRasmus Steinke <rasi@xssn.at>2014-08-25 00:54:07 +0200
commit70b548923993fd599cd538c8eace6e6dfe2bdd56 (patch)
tree4d06884a28700e838dc51ae1ac2807aeb3449c7f /clerk
parentc5ad2db24d1e84c83243f37f31f4d9494484c30f (diff)
downloadperl-app-clerk-70b548923993fd599cd538c8eace6e6dfe2bdd56.tar.gz
perl-app-clerk-70b548923993fd599cd538c8eace6e6dfe2bdd56.tar.xz
fixed errors
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"