Created
April 18, 2018 10:26
-
-
Save rxw1/50cb1772f5395e4ccb2fcfeae8ea10d4 to your computer and use it in GitHub Desktop.
Rate Sort Delete
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env zsh | |
music=/mnt/unsort/storage/music | |
playing=$music/$(mpc -f %file% current) | |
case $1 in | |
rate) | |
if [[ $2 -ge 0 ]] && [[ $2 -lt 6 ]]; then | |
mpc sticker "$(mpc -f %file% current)" set rating $2 | |
fi | |
;; | |
rating) | |
mpc sticker "$(mpc -f %file% current)" get rating | |
;; | |
sort) | |
beet -v -l $music/sorted.db -d $music/sorted import $playing | |
;; | |
delete) | |
echo rm -v $playing | |
;; | |
esac |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment