commit adc95f909bbf1a760ae22968389ac456d3f68bff parent 34e27437188af6e88e0741bd640182045784f295 Author: Anders Damsgaard <anders@adamsgaard.dk> Date: Thu, 4 Oct 2018 14:44:08 +0200 Improve handling of albums Diffstat:
M | links/bin/mpc-play-newest.sh | | | 14 | +++++++++++--- |
1 file changed, 11 insertions(+), 3 deletions(-)
diff --git a/links/bin/mpc-play-newest.sh b/links/bin/mpc-play-newest.sh @@ -1,4 +1,12 @@ #!/usr/bin/env bash -mpc clear -grep 'added' ~/.mpd/log | sed 's/.*added //' | tail -n 100 | tac | mpc add -mpc play +mpc clear >/dev/null + +#grep 'added' ~/.mpd/log | sed 's/.*added //' | tail -n 100 | tac | mpc add +albums="$(mpc-newest.sh | sed 's/.* - //')" + +while read -r album; do + echo "$album" + mpc search album "$album" | mpc insert +done <<< "$albums" + +mpc play >/dev/null