From ad6caa8e7e21fff9f639be2c8536e049795e9477 Mon Sep 17 00:00:00 2001 From: Sumon Ghosh Date: Wed, 6 May 2026 02:22:09 +0530 Subject: [PATCH 1/2] feat: keep ongoing anime selectable in -c and integrate nextep countdown --- ani-cli | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/ani-cli b/ani-cli index 1ef06a793..05cd2e558 100755 --- a/ani-cli +++ b/ani-cli @@ -348,7 +348,11 @@ process_hist_entry() { latest_ep=$(printf "%s\n" "$ep_list" | tail -n1) title=$(printf "%s\n" "$title" | sed "s|[0-9]\+ episodes|${latest_ep} episodes|") ep_no=$(printf "%s" "$ep_list" | sed -n "/^${ep_no}$/{n;p;}") 2>/dev/null - [ -n "$ep_no" ] && printf "%s\t%s - episode %s\n" "$id" "$title" "$ep_no" + if [ -n "$ep_no" ]; then + printf "%s\t%s - episode %s\n" "$id" "$title" "$ep_no" + else + printf "%s\t%s - episode %s (up to date)\n" "$id" "$title" "$latest_ep" + fi } update_history() { @@ -594,6 +598,9 @@ case "$search" in ep_list=$(episodes_list "$id") ep_no=$(printf "%s" "$anime_list" | grep "$id" | cut -f2 | sed -nE 's/.*- episode (.+)$/\1/p') allanime_title="$(printf "%s" "$title" | cut -d'(' -f1 | tr -d '[:punct:]')" + if printf "%s" "$anime_list" | grep "$id" | cut -f2 | grep -q "(up to date)"; then + time_until_next_ep "$allanime_title" + fi ;; *) if [ "$use_external_menu" = "0" ]; then From 6fb2c45256094e56a90f4dfc2083869636d47b82 Mon Sep 17 00:00:00 2001 From: Sumon Ghosh Date: Wed, 6 May 2026 23:10:34 +0530 Subject: [PATCH 2/2] fix: use && || flow control and bump version --- ani-cli | 13 ++++--------- 1 file changed, 4 insertions(+), 9 deletions(-) diff --git a/ani-cli b/ani-cli index 05cd2e558..003e993e8 100755 --- a/ani-cli +++ b/ani-cli @@ -1,6 +1,6 @@ #!/bin/sh -version_number="4.14.0" +version_number="4.14.1" # UI @@ -348,11 +348,8 @@ process_hist_entry() { latest_ep=$(printf "%s\n" "$ep_list" | tail -n1) title=$(printf "%s\n" "$title" | sed "s|[0-9]\+ episodes|${latest_ep} episodes|") ep_no=$(printf "%s" "$ep_list" | sed -n "/^${ep_no}$/{n;p;}") 2>/dev/null - if [ -n "$ep_no" ]; then - printf "%s\t%s - episode %s\n" "$id" "$title" "$ep_no" - else - printf "%s\t%s - episode %s (up to date)\n" "$id" "$title" "$latest_ep" - fi + [ -n "$ep_no" ] && printf "%s\t%s - episode %s\n" "$id" "$title" "$ep_no" + [ -n "$ep_no" ] || printf "%s\t%s - episode %s (up to date)\n" "$id" "$title" "$latest_ep" } update_history() { @@ -598,9 +595,7 @@ case "$search" in ep_list=$(episodes_list "$id") ep_no=$(printf "%s" "$anime_list" | grep "$id" | cut -f2 | sed -nE 's/.*- episode (.+)$/\1/p') allanime_title="$(printf "%s" "$title" | cut -d'(' -f1 | tr -d '[:punct:]')" - if printf "%s" "$anime_list" | grep "$id" | cut -f2 | grep -q "(up to date)"; then - time_until_next_ep "$allanime_title" - fi + printf "%s" "$anime_list" | grep "$id" | cut -f2 | grep -q "(up to date)" && time_until_next_ep "$allanime_title" ;; *) if [ "$use_external_menu" = "0" ]; then