Skip to content
Permalink
Browse files

good idea, cancer execution

  • Loading branch information...
neeasade committed Jun 29, 2019
1 parent eecbd97 commit 1c624954906490b380584e289246927c903aaed3
Showing with 36 additions and 0 deletions.
  1. +36 −0 bin/bin/music
@@ -1,4 +1,5 @@
#!/usr/bin/env bash
# -*- eval: (setq-local sh-basic-offset 2) -*-

musicdir="$HOME/Music"

@@ -37,6 +38,40 @@ shuffle() {
mpc play
}

shuffle_mixes() {

# probably cache this later
is_mix() {
milli="$(mediainfo --Inform="Audio;%Duration%" "$*" | sed 's/\..*//')"

if [ -z "$milli" ]; then
# ¯\_(ツ)_/¯
return 1
fi

seconds=$(( $milli / 1000))
if [ $seconds -gt $((60 * 25)) ]; then
return 0
else
return 1
fi
}

# mpc clear
# this is gonna take forever
list_mixes() {
while read -r song; do
if is_mix "${musicdir}/$song"; then
echo "$song"
fi
done < <(mpc listall)
}

mpc clear
list_mixes | grep -v ASOT | grep -v "Dream Dance" | grep -v "Tiësto" | sort -R | head -n 1000 | mpc add
mpc play
}

append() {
echo append "$*"
mpc listall | grep -i "$*" | mpc add
@@ -58,6 +93,7 @@ now() {
if song="$(mpc listall | fzf)"; then
mpc insert "$song"
mpc next
mpc play
fi
}

0 comments on commit 1c62495

Please sign in to comment.
You can’t perform that action at this time.