summaryrefslogtreecommitdiffstats
path: root/clerk
diff options
context:
space:
mode:
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
}