diff --git a/utils/playlist2ini.sh b/utils/playlist2ini.sh index a6d3e5a..82ef77c 100755 --- a/utils/playlist2ini.sh +++ b/utils/playlist2ini.sh @@ -7,9 +7,9 @@ set -euo pipefail # Use at own risk :-) -mpc -f '[[%artist%] - %title%]#|%file%#|%time%' playlist | while IFS='|' read title file time; do - if test -n "$title"; then - title="$(basename "$title")" +mpc -f '[[%artist% - ]%title%]#|%file%#|%time%' playlist | while IFS='|' read title file time; do + if test -z "$title"; then + title="$(basename "$file")" fi echo -e "[$title]\npath = $file\ntime = $time\n"