Recently Written · git

sad

sad (2f30.org simple audio daemon) with a Cygwin/OSS port on branch cygwin

git clone https://github.com/equwal/sad

Log | Files | Refs


commit 975c54620afb032cc9564f806757e1a0d2077c21
Hiltjo Posthuma <hiltjo@codemadness.org>
2014-12-28 23:18:58 +0100

scripts/sad-add: change to library "learn"

 scripts/sad-add | 8 +++++++-
 1 file changed, 7 insertions(+), 1 deletion(-)
diff --git a/scripts/sad-add b/scripts/sad-add
index 1022f9f..ab86a63 100755
--- a/scripts/sad-add
+++ b/scripts/sad-add
@@ -12,8 +12,14 @@ while read -r p; do
 		\( -iname "*.mp3" -or \
 		-iname "*.ogg" -or \
 		-iname "*.wav" \) \
-		-exec printf 'add %s\n' {} \; | \
+		-exec echo learn {} \; | \
 		nc -U "$sock"
 done <<!__EOF__
 $paths
 !__EOF__
+
+# add library to playlist.
+echo "library" | nc -U "$sock" | while read -r song; do
+	id=$(printf '%s' "$song" | cut -d ':' -f 1)
+	echo "add" "$id"
+done | nc -U "$sock"