summaryrefslogtreecommitdiffstats
path: root/clerk
diff options
context:
space:
mode:
Diffstat (limited to 'clerk')
-rwxr-xr-xclerk17
1 files changed, 16 insertions, 1 deletions
diff --git a/clerk b/clerk
index b8ebd27..16f7d2c 100755
--- a/clerk
+++ b/clerk
@@ -625,6 +625,20 @@ rateTrack () {
fi
}
+ instantRateTrack () {
+ mpc sticker "$(mpc current -f '%file%')" set rating "$rating"
+ if [[ "$music_dir_access" == "yes" ]]; then
+ cd "$music_path"
+ cd "$(dirname "$(mpc current -f %file%)")"
+ if [[ "$(pwd)" == */"$cd_divider"* ]]; then
+ cd ..
+ fi
+ touch track.ratings
+ sed -i "/$(mpc current -f '%title%')/d" track.ratings
+ echo "$rating\\$(mpc current -f "%artist%\%track%\%title%\%date%\%album%")" >> track.ratings
+ fi
+ }
+
loadRatedAlbums () {
rating="$(seq 10 | rofi -dmenu -p "Minimum Rating > ")"
@@ -1348,7 +1362,8 @@ elif [[ "$1" == "-resume" ]]; then
elif [[ "$1" == "-playlists" ]]; then
managePlaylists
elif [[ "$1" == "-rcurrent" ]]; then
- mpc sticker "$(mpc current -f '%file%')" set rating $2
+ export rating="$2"
+ instantRateTrack
else
dplayPrompt
fi