Skip to content

Commit ad6caa8

Browse files
committed
feat: keep ongoing anime selectable in -c and integrate nextep countdown
1 parent 6803b8a commit ad6caa8

1 file changed

Lines changed: 8 additions & 1 deletion

File tree

ani-cli

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -348,7 +348,11 @@ process_hist_entry() {
348348
latest_ep=$(printf "%s\n" "$ep_list" | tail -n1)
349349
title=$(printf "%s\n" "$title" | sed "s|[0-9]\+ episodes|${latest_ep} episodes|")
350350
ep_no=$(printf "%s" "$ep_list" | sed -n "/^${ep_no}$/{n;p;}") 2>/dev/null
351-
[ -n "$ep_no" ] && printf "%s\t%s - episode %s\n" "$id" "$title" "$ep_no"
351+
if [ -n "$ep_no" ]; then
352+
printf "%s\t%s - episode %s\n" "$id" "$title" "$ep_no"
353+
else
354+
printf "%s\t%s - episode %s (up to date)\n" "$id" "$title" "$latest_ep"
355+
fi
352356
}
353357

354358
update_history() {
@@ -594,6 +598,9 @@ case "$search" in
594598
ep_list=$(episodes_list "$id")
595599
ep_no=$(printf "%s" "$anime_list" | grep "$id" | cut -f2 | sed -nE 's/.*- episode (.+)$/\1/p')
596600
allanime_title="$(printf "%s" "$title" | cut -d'(' -f1 | tr -d '[:punct:]')"
601+
if printf "%s" "$anime_list" | grep "$id" | cut -f2 | grep -q "(up to date)"; then
602+
time_until_next_ep "$allanime_title"
603+
fi
597604
;;
598605
*)
599606
if [ "$use_external_menu" = "0" ]; then

0 commit comments

Comments
 (0)