mirror of
https://github.com/ksyasuda/aniwrapper.git
synced 2024-11-22 03:19:53 -08:00
Compare commits
2 Commits
80682a26db
...
af7dee7d85
Author | SHA1 | Date | |
---|---|---|---|
|
af7dee7d85 | ||
|
822e40074c |
50
aniwrapper
50
aniwrapper
@ -89,28 +89,7 @@ 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
|
||||||
if ((IS_AUTOPLAY)); then
|
$CMD -D"$DPI" "$@"
|
||||||
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() {
|
||||||
@ -308,21 +287,26 @@ 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() {
|
||||||
@ -340,8 +324,8 @@ get_dl_dir() {
|
|||||||
}
|
}
|
||||||
|
|
||||||
main() {
|
main() {
|
||||||
((SILENT != 1)) && lg "CONFIG DIR: $CFG_DIR"
|
((!SILENT)) && lg "CONFIG DIR: $CFG_DIR"
|
||||||
((SILENT != 1)) && lg "ROFI CFG: $CFG_FILE"
|
((!SILENT)) && 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')
|
||||||
@ -353,19 +337,19 @@ main() {
|
|||||||
case "$selection" in
|
case "$selection" in
|
||||||
1.)
|
1.)
|
||||||
lg "Streaming mode"
|
lg "Streaming mode"
|
||||||
run
|
run "${args[@]}"
|
||||||
;;
|
;;
|
||||||
2.)
|
2.)
|
||||||
lg "Download anime"
|
lg "Download anime"
|
||||||
get_dl_dir && run -d "$dl_dir"
|
get_dl_dir && run "${args[@]}" -d "$dl_dir"
|
||||||
;;
|
;;
|
||||||
3.)
|
3.)
|
||||||
lg "Continue watching"
|
lg "Continue watching"
|
||||||
run -H
|
run -H "${args[@]}"
|
||||||
;;
|
;;
|
||||||
4.)
|
4.)
|
||||||
lg "Showing recently updated anime"
|
lg "Showing recently updated anime"
|
||||||
run -R
|
run -R "${args[@]}"
|
||||||
;;
|
;;
|
||||||
5.)
|
5.)
|
||||||
lg "Play from file selected"
|
lg "Play from file selected"
|
||||||
@ -383,9 +367,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"
|
run -f"$DEFAULT_DOWNLOAD" "${args[@]}"
|
||||||
else
|
else
|
||||||
run -f"$play_dir"
|
run -f"$play_dir" "${args[@]}"
|
||||||
fi
|
fi
|
||||||
exit $?
|
exit $?
|
||||||
;;
|
;;
|
||||||
|
Loading…
Reference in New Issue
Block a user