Skip to content

Instantly share code, notes, and snippets.

@rxw1
Created April 18, 2018 10:26
Show Gist options
  • Save rxw1/50cb1772f5395e4ccb2fcfeae8ea10d4 to your computer and use it in GitHub Desktop.
Save rxw1/50cb1772f5395e4ccb2fcfeae8ea10d4 to your computer and use it in GitHub Desktop.
Rate Sort Delete
#!/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