Browse Source

Update pod command

Samuel W. Flint 1 year ago
parent
commit
86442d268c
1 changed files with 10 additions and 4 deletions
  1. 10 4
      pod

+ 10 - 4
pod

@@ -1,4 +1,4 @@
-#!/bin/sh
+#!/usr/bin/env bash
 
 POD_BASE_DIR=${POD_BASE_DIR:-~/Music/}
 POD_SUB_DIR=${POD_SUB_DIR:-Podcasts}
@@ -146,9 +146,15 @@ case "$CMD" in
         CUR_DIR=$(pwd)
         cd $POD_BASE_DIR
         grep -v '^# ' ${POD_SUB_DIR}/podcasts-list.txt |\
-            cut -f2 |\
-            xargs -L1 git annex importfeed \
-                  --template="${POD_SUB_DIR}/\${feedtitle}/\${itempubdate}-\${itemtitle}\${extension}"
+            while read -r LINE; do
+                URL=${LINE##*	}
+                TITLE=${LINE%	*}
+                echo "Downloading ${TITLE}..."
+                git annex importfeed \
+                    --template="${POD_SUB_DIR}/\${feedtitle}/\${itempubdate}-\${itemtitle}\${extension}" \
+                    "${URL}"
+                echo
+            done
         git annex add ${POD_SUB_DIR}
         git commit -m "Caught podcasts"
         git annex find --include='Podcasts/*' --and --not --metadata tag=listened |\