diff options
Diffstat (limited to 'scripts/mpc_add_query.sh')
-rwxr-xr-x | scripts/mpc_add_query.sh | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/scripts/mpc_add_query.sh b/scripts/mpc_add_query.sh index 08a1c20..03e39e0 100755 --- a/scripts/mpc_add_query.sh +++ b/scripts/mpc_add_query.sh @@ -1,5 +1,7 @@ #!/bin/sh query=${1} -cd ~/music -find . -iname "*$query*" -type f | while read -r line; do echo "$line"; mpc insert "${line#./}"; done +mpc -f "%title%[\t\t%artist%][\t\t%album%]\t\t%file%" listall | grep -i "${query}" | rev | cut -f1 -d' ' | rev | while read -r track; do + echo "$track" + mpc insert "$track" +done |