summaryrefslogtreecommitdiffstats
path: root/clerk
diff options
context:
space:
mode:
authorRasmus Steinke <rasi@xssn.at>2014-08-25 01:24:39 +0200
committerRasmus Steinke <rasi@xssn.at>2014-08-25 01:24:39 +0200
commit62fc8443eff38c6735046030489f66a61b92208e (patch)
tree991c471b3c9989aedd5f3bfdc4e82e841c9e8e11 /clerk
parentabe3fdc85df13a0287db56e614617a65c1ddff2c (diff)
downloadperl-app-clerk-62fc8443eff38c6735046030489f66a61b92208e.tar.gz
perl-app-clerk-62fc8443eff38c6735046030489f66a61b92208e.tar.xz
trying autoupdate
Diffstat (limited to 'clerk')
-rw-r--r--clerk8
1 files changed, 8 insertions, 0 deletions
diff --git a/clerk b/clerk
index 37e34f0..3bfd841 100644
--- a/clerk
+++ b/clerk
@@ -677,6 +677,10 @@ currentTracksInsert () {
rateAlbum () {
+ artist=$(mpc current -f %artist%)
+ album=$(mpc current -f %album%)
+ date=$(mpc current -f %date%)
+ directory=$(dirname $(mpc current -f %file%))
ratings="$(seq $maxratings | dmenu_t -p "Select Rating: > ")"
if [ ratings = "" ]; then
exit
@@ -704,7 +708,9 @@ rateAlbum () {
cp $HOME/.config/clerk/ratings/"$(mpc current -f %artist%--%date%--%album%).ratings" .
fi
notify-send "clerk" "Rated $(mpc current -f "%$mpd_artist% - %album%") with $ratings"
+ sqlite3 ../ratings.db "insert or replace into albums (date, artist, album, directory, rating) values ('$date', '$artist', '$album', '$directory', '$rating')"
fi
+ ratingPrompt
}
rateTrack () {
@@ -738,6 +744,8 @@ rateTrack () {
cp $HOME/.config/clerk/ratings/"$(mpc current -f %artist%--%date%--%album%).ratings" .
fi
notify-send "clerk" "Rated $(mpc current -f "%$mpd_artist% - %title%") with $ratings"
+ updateDB
+ ratingPrompt
}