Browse Source

Add in EXPORT command

Samuel W. Flint 1 year ago
parent
commit
67d1a1af4f
1 changed files with 21 additions and 11 deletions
  1. 21 11
      pod

+ 21 - 11
pod

@@ -3,8 +3,11 @@
 POD_BASE_DIR=${POD_BASE_DIR:-~/Music/}
 POD_SUB_DIR=${POD_SUB_DIR:-Podcasts}
 
+POD_EXPORT_BRANCH=${POD_EXPORT_BRANCH:-master}
+POD_EXPORT_TARGET=${POD_EXPORT_TARGET:-sansa-cast}
+
 show_usage() {
-    echo "$(basename $0) [ list | play [ FILE ] | pick [-x] | pause | stop | listened | update-feeds | wanted ]" >&2
+    echo "$(basename $0) [ list | list-all | play [ FILE ] | pick [-x] | pause | stop | listened | update-feeds | wanted | export [ BRANCH [ TARGET ] ] ]" >&2
 }
 
 show_help() {
@@ -12,16 +15,17 @@ show_help() {
     cat <<EOF
 $(basename $0): Manage podcasts
 
-help                : show help
-list                : list local podcast episodes
-list-all            : list all podcast episodes
-play [ FILE ]       : if FILE, play, picking up from where last paused/stopped
-pick  [ -x ]        : pick a podcast to play, if -x, using an X-windows picker
-pause               : pause current episode, saving current location
-stop                : stop current episode, saving current location
-listened [ FILE* ]  : mark current episode as listened or if FILES mark them
-update-feeds        : update feeds
-wanted              : list wanted episodes
+help                     : show help
+list                     : list local podcast episodes
+list-all                 : list all podcast episodes
+play [ FILE ]            : if FILE, play, picking up from where last paused/stopped
+pick  [ -x ]             : pick a podcast to play, if -x, using an X-windows picker
+pause                    : pause current episode, saving current location
+stop                     : stop current episode, saving current location
+listened [ FILE* ]       : mark current episode as listened or if FILES mark them
+update-feeds             : update feeds
+wanted                   : list wanted episodes
+export [ BRNCH ] [ TGT ] : export unlistened podcasts to device
 EOF
 }
 
@@ -165,6 +169,12 @@ case "$CMD" in
         find_unlistened --not --in=here
         exit
         ;;
+    export)
+        BRANCH=${1:-${POD_EXPORT_BRANCH}}
+        TARGET=${2:-${POD_EXPORT_TARGET}}
+        git_annex_wrap export "${BRANCH}" -t "${TARGET}"
+        exit
+        ;;
     *)
         show_usage
         echo