Compare commits

..

No commits in common. "af7dee7d858f5f3d6e08b266e2548f0571b3e33d" and "80682a26dbf06177ca5af5603bd05e3541056b62" have entirely different histories.

View File

@ -89,7 +89,28 @@ run() {
if ((!IS_PLAY_FROM_FILE && !IS_SYNC && GET_QUALITY)); then if ((!IS_PLAY_FROM_FILE && !IS_SYNC && GET_QUALITY)); then
get_quality get_quality
fi fi
$CMD -D"$DPI" "$@" if ((IS_AUTOPLAY)); then
CMD="$CMD -a"
fi
if ((SILENT)); then
if ((!IS_CUSTOM_THEME)); then
$CMD -D"$DPI" -Sq "$QUALITY" -t "$theme" -p "$PLAYER_FN" "$@"
else
$CMD -D"$DPI" -Sq "$QUALITY" -T "$CFG_FILE" -p "$PLAYER_FN" "$@"
fi
elif ((VERBOSE)); then
if ((!IS_CUSTOM_THEME)); then
$CMD -D"$DPI" -vq "$QUALITY" -t "$theme" -p "$PLAYER_FN" "$@"
else
$CMD -D"$DPI" -vq "$QUALITY" -T "$CFG_FILE" -p "$PLAYER_FN" "$@"
fi
else
if ((!IS_CUSTOM_THEME)); then
$CMD -D"$DPI" -q "$QUALITY" -t "$theme" -p "$PLAYER_FN" "$@"
else
$CMD -D"$DPI" -q "$QUALITY" -T "$CFG_FILE" -p "$PLAYER_FN" "$@"
fi
fi
} }
get_quality() { get_quality() {
@ -287,26 +308,21 @@ check_flags() {
if ((IS_ALTERNATE_PLAYER)); then if ((IS_ALTERNATE_PLAYER)); then
args+=(-p "$PLAYER_FN") args+=(-p "$PLAYER_FN")
fi fi
if ((IS_QUALITY)); then
args+=(-q)
fi
if ((IS_RESUME)); then if ((IS_RESUME)); then
args+=(-r) args+=(-r)
fi fi
if ((IS_SILENT)); then
args+=(-S)
fi
if ((IS_CUSTOM_THEME)); then if ((IS_CUSTOM_THEME)); then
args+=(-T "$CFG_FILE") args+=(-T "$CFG_FILE")
elif ((!IS_CUSTOM_THEME)); then elif ((!IS_CUSTOM_THEME)); then
args+=(-t "$theme") args+=(-t "$theme")
fi fi
if ((IS_VERBOSE)); then
args+=(-v)
fi
lg "ARGS: ${args[*]}" lg "ARGS: ${args[*]}"
if ((IS_DOWNLOAD || !IS_ROFI || IS_RESUME || IS_PLAY_FROM_FILE)); then
run "${args[@]}" "$@" run "${args[@]}" "$@"
exit $? exit $?
fi
} }
get_dl_dir() { get_dl_dir() {
@ -324,8 +340,8 @@ get_dl_dir() {
} }
main() { main() {
((!SILENT)) && lg "CONFIG DIR: $CFG_DIR" ((SILENT != 1)) && lg "CONFIG DIR: $CFG_DIR"
((!SILENT)) && lg "ROFI CFG: $CFG_FILE" ((SILENT != 1)) && lg "ROFI CFG: $CFG_FILE"
choice=$(echo "${options[@]}" | rofi -dpi "$DPI" -dmenu -no-custom -sep '|' \ choice=$(echo "${options[@]}" | rofi -dpi "$DPI" -dmenu -no-custom -sep '|' \
-theme-str 'listview {columns: 2;} window {width: 45%;}' \ -theme-str 'listview {columns: 2;} window {width: 45%;}' \
-config "$CFG_FILE" -l 4 -i -p "Aniwrapper" -window-title 'aniwrapper') -config "$CFG_FILE" -l 4 -i -p "Aniwrapper" -window-title 'aniwrapper')
@ -337,19 +353,19 @@ main() {
case "$selection" in case "$selection" in
1.) 1.)
lg "Streaming mode" lg "Streaming mode"
run "${args[@]}" run
;; ;;
2.) 2.)
lg "Download anime" lg "Download anime"
get_dl_dir && run "${args[@]}" -d "$dl_dir" get_dl_dir && run -d "$dl_dir"
;; ;;
3.) 3.)
lg "Continue watching" lg "Continue watching"
run -H "${args[@]}" run -H
;; ;;
4.) 4.)
lg "Showing recently updated anime" lg "Showing recently updated anime"
run -R "${args[@]}" run -R
;; ;;
5.) 5.)
lg "Play from file selected" lg "Play from file selected"
@ -367,9 +383,9 @@ main() {
lg "Play dir: $play_dir" lg "Play dir: $play_dir"
if [ -z "$play_dir" ]; then if [ -z "$play_dir" ]; then
mkdir -p "$DEFAULT_DOWNLOAD" || die "error creating default download directory" mkdir -p "$DEFAULT_DOWNLOAD" || die "error creating default download directory"
run -f"$DEFAULT_DOWNLOAD" "${args[@]}" run -f"$DEFAULT_DOWNLOAD"
else else
run -f"$play_dir" "${args[@]}" run -f"$play_dir"
fi fi
exit $? exit $?
;; ;;