mirror of
https://github.com/ksyasuda/aniwrapper.git
synced 2024-10-28 04:44:11 -07:00
fix aniwrapper get_quality not setting properly
also add ability to specify quality in command-line mode
This commit is contained in:
parent
e883c5fa6a
commit
e7f365c173
13
aniwrapper
13
aniwrapper
@ -26,15 +26,18 @@ options="1. Stream|2. Download|3. Continue|4. Playlist|5. Sync History|$quit"
|
||||
# Functions #
|
||||
#############
|
||||
get_quality() {
|
||||
if [[ "$IS_ROFI" -eq 1 ]]; then
|
||||
selection=$(rofi -dmenu -config "$CFG_DIR/$CFG_FILE" \
|
||||
-l 1 -p "Choose video quality:" -sep '|' <<< "$QUALITIES")
|
||||
QUALITY=$(awk '{print $2}' <<< "$selection")
|
||||
log "selected quality: $QUALITY"
|
||||
if [[ "$QUALITY" == 'best' || "$QUALITY" == 'worst' ]]; then
|
||||
log "QUALITY: $QUALITY"
|
||||
else
|
||||
seppuku "Something went wrong getting the quality: $QUALITY... exiting"
|
||||
printf "%s" "Enter quality [ best | worst ]: "
|
||||
read -r QUALITY
|
||||
fi
|
||||
log "selected quality: $QUALITY"
|
||||
# if [[ "$QUALITY" != 'best' ]] && [[ "$QUALITY" != 'worst' ]]; then
|
||||
# seppuku "Something went wrong getting the quality: $QUALITY... exiting"
|
||||
# fi
|
||||
}
|
||||
|
||||
seppuku() {
|
||||
@ -78,7 +81,7 @@ while getopts 'vhqcd' OPT; do
|
||||
VERBOSE=1
|
||||
;;
|
||||
q)
|
||||
QUALITY=1
|
||||
GET_QUALITY=1
|
||||
log "Quality prompt enabled"
|
||||
;;
|
||||
c)
|
||||
|
Loading…
Reference in New Issue
Block a user