]> git.phdru.name Git - audio-cdr-video.git/commitdiff
Add `cat-playlists` master
authorOleg Broytman <phd@phdru.name>
Fri, 24 Feb 2023 12:07:41 +0000 (15:07 +0300)
committerOleg Broytman <phd@phdru.name>
Fri, 24 Feb 2023 12:07:41 +0000 (15:07 +0300)
Add a script to concatenate playlists from subdirectories.

audio/cat-playlists [new file with mode: 0755]

diff --git a/audio/cat-playlists b/audio/cat-playlists
new file mode 100755 (executable)
index 0000000..cd18eac
--- /dev/null
@@ -0,0 +1,7 @@
+#! /bin/sh
+set -e
+
+find . -mindepth 1 -type d -printf '"%P"\n' | sort | sed 's/`/\\`/' |
+xargs -I% -n1 sh -c \
+    'test -f "%"/PlayList.m3u && cat "%"/PlayList.m3u | sed -e "s\^\%/\\"' \
+> PlayList.m3u