Fix "time" to only contain reasonable values

When a song longer than 24 minutes is in the playlist, the time
attribute of the INI is not parseable, causing a crash of the app.
master
LEdoian 3 years ago
parent 6372b3da78
commit c32cab9ee0

@ -7,10 +7,11 @@ set -euo pipefail
# Use at own risk :-)
mpc -f '[[%artist% - ]%title%]#|%file%#|%time%' playlist | while IFS='|' read title file time; do
mpc -f '[[%artist% - ]%title%]#|%file%' playlist | while IFS='|' read title file; do
if test -z "$title"; then
title="$(basename "$file")"
fi
echo -e "[$title]\npath = $file\ntime = $time\n"
# Unfortunately, the "time" attribute is currently required
echo -e "[$title]\npath = $file\ntime = 2:00\n"
done

Loading…
Cancel
Save