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
|
endpoint=https://bt.uninsane.org/transmission/rpc
|
||||||
PASS=$(sudo cat /run/secrets/transmission_passwd)
|
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}"
|
eval "set -- ${options}"
|
||||||
|
|
||||||
|
type=
|
||||||
|
title=
|
||||||
|
author=
|
||||||
prefix=
|
prefix=
|
||||||
while true; do
|
while true; do
|
||||||
case "$1" in
|
case "$1" in
|
||||||
|
@ -17,12 +20,36 @@ while true; do
|
||||||
shift
|
shift
|
||||||
;;
|
;;
|
||||||
(--film)
|
(--film)
|
||||||
prefix=Videos/Film/
|
type=Videos/Film/
|
||||||
shift
|
shift
|
||||||
;;
|
;;
|
||||||
(--series)
|
(--show)
|
||||||
|
type=Videos/Shows/
|
||||||
shift
|
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
|
shift
|
||||||
;;
|
;;
|
||||||
(--)
|
(--)
|
||||||
|
@ -37,9 +64,13 @@ while true; do
|
||||||
;;
|
;;
|
||||||
esac
|
esac
|
||||||
done
|
done
|
||||||
|
|
||||||
|
prefix=$prefix$type$author$title
|
||||||
# positional ("non-option") parameters
|
# positional ("non-option") parameters
|
||||||
torrent="$1"
|
torrent="$1"
|
||||||
|
|
||||||
|
echo "saving to $prefix"
|
||||||
|
|
||||||
transmission-remote "$endpoint" \
|
transmission-remote "$endpoint" \
|
||||||
--auth "colin:$PASS" \
|
--auth "colin:$PASS" \
|
||||||
--download-dir "/var/lib/uninsane/media/$prefix" \
|
--download-dir "/var/lib/uninsane/media/$prefix" \
|
||||||
|
|
Loading…
Reference in New Issue
Block a user