Skip to content

Commit

Permalink
fix: previous,next,replay bug (#1028)
Browse files Browse the repository at this point in the history
Co-authored-by: RaynardGerraldo <[email protected]>
  • Loading branch information
RaynardGerraldo and RaynardGerraldo authored Feb 10, 2023
1 parent 3ded233 commit 817657e
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions ani-cli
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
#!/bin/sh

version_number="4.0.8"
version_number="4.0.9"

# UI

Expand Down Expand Up @@ -226,6 +226,8 @@ play_episode() {
*) nohup "$player_function" "$episode" >/dev/null 2>&1 & ;;
esac
update_history
replay="$episode"
unset episode
wait
}

Expand All @@ -242,7 +244,6 @@ play() {
for i in $range; do
tput clear
ep_no=$i
unset episode
printf "\33[2K\r\033[1;34mPlaying episode %s...\033[0m\n" "$ep_no"
play_episode
done
Expand Down Expand Up @@ -380,7 +381,7 @@ play
while cmd=$(printf "next\nreplay\nprevious\nselect\nchange_quality\nquit" | nth "Playing episode $ep_no of $title... "); do
case "$cmd" in
next) ep_no=$(printf "%s" "$ep_list" | sed -n "/^${ep_no}$/{n;p;}") 2>/dev/null ;;
replay) ;;
replay) episode="$replay";;
previous) ep_no=$(printf "%s" "$ep_list" | sed -n "/^${ep_no}$/{g;1!p;};h") 2>/dev/null ;;
select) ep_no=$(printf "%s" "$ep_list" | nth "Select episode: " "$multi_selection_flag") ;;
change_quality) episode=$(printf "%s" "$links" | sed -n '/^\([0-9]*p\)/p' | launcher)
Expand All @@ -390,7 +391,6 @@ while cmd=$(printf "next\nreplay\nprevious\nselect\nchange_quality\nquit" | nth
esac
[ -z "$ep_no" ] && die "Out of range"
play
unset episode
done

# ani-cli
Expand Down

0 comments on commit 817657e

Please sign in to comment.