sane-bt-add: implement --audiobook, --vn options
This commit is contained in:
parent
2dbf3b4732
commit
5d0630cad4
|
@ -5,9 +5,12 @@ set -e
|
|||
endpoint=https://bt.uninsane.org/transmission/rpc
|
||||
PASS=$(sudo cat /run/secrets/transmission_passwd)
|
||||
|
||||
options=$(getopt -l film,series:,prefix: -- "" "${@}")
|
||||
options=$(getopt -l prefix:,film,show:,book:,audiobook:,vn:,author: -- "" "${@}")
|
||||
eval "set -- ${options}"
|
||||
|
||||
type=
|
||||
title=
|
||||
author=
|
||||
prefix=
|
||||
while true; do
|
||||
case "$1" in
|
||||
|
@ -17,12 +20,36 @@ while true; do
|
|||
shift
|
||||
;;
|
||||
(--film)
|
||||
prefix=Videos/Film/
|
||||
type=Videos/Film/
|
||||
shift
|
||||
;;
|
||||
(--series)
|
||||
(--show)
|
||||
type=Videos/Shows/
|
||||
shift
|
||||
prefix=Videos/Shows/"$1"/
|
||||
title="$1"/
|
||||
shift
|
||||
;;
|
||||
(--book)
|
||||
type=Books/Books/
|
||||
shift
|
||||
title="$1"/
|
||||
shift
|
||||
;;
|
||||
(--audiobook)
|
||||
type=Books/Audiobooks/
|
||||
shift
|
||||
title="$1"/
|
||||
shift
|
||||
;;
|
||||
(--vn)
|
||||
type=Books/Visual/
|
||||
shift
|
||||
title="$1"/
|
||||
shift
|
||||
;;
|
||||
(--author)
|
||||
shift
|
||||
author="$1"/
|
||||
shift
|
||||
;;
|
||||
(--)
|
||||
|
@ -37,9 +64,13 @@ while true; do
|
|||
;;
|
||||
esac
|
||||
done
|
||||
|
||||
prefix=$prefix$type$author$title
|
||||
# positional ("non-option") parameters
|
||||
torrent="$1"
|
||||
|
||||
echo "saving to $prefix"
|
||||
|
||||
transmission-remote "$endpoint" \
|
||||
--auth "colin:$PASS" \
|
||||
--download-dir "/var/lib/uninsane/media/$prefix" \
|
||||
|
|
Loading…
Reference in New Issue
Block a user