fix aniwrapper get_quality not setting properly

also add ability to specify quality in command-line mode
This commit is contained in:
ksyasuda 2021-12-30 21:39:41 -08:00
parent e883c5fa6a
commit e7f365c173

View File

@ -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)