From d061438e2e7b96655af6362cb7022333a855d7de Mon Sep 17 00:00:00 2001 From: ksyasuda Date: Mon, 25 Apr 2022 19:30:38 -0700 Subject: [PATCH] allow episode 0 --- ani-cli | 2 +- sql/history.sql | 1 - 2 files changed, 1 insertion(+), 2 deletions(-) diff --git a/ani-cli b/ani-cli index 2360977..afa65a0 100755 --- a/ani-cli +++ b/ani-cli @@ -706,7 +706,7 @@ episode_selection() { read -r ep_choice_start ep_choice_end [[ -z "$ep_choice_end" ]] && ep_choice_end="$ep_choice_start" fi - if (((ep_choice_start <= 0 || ep_choice_start > LAST_EP_NUMBER) || ep_choice_end < ep_choice_start || ep_choice_end > LAST_EP_NUMBER)); then + if (((ep_choice_start < 0 || ep_choice_start > LAST_EP_NUMBER) || ep_choice_end < ep_choice_start || ep_choice_end > LAST_EP_NUMBER)); then die "Invalid episode/range entered: ep_start -> $ep_choice_start | ep_end -> $ep_choice_end" fi } diff --git a/sql/history.sql b/sql/history.sql index 7e54a79..74c6d65 100644 --- a/sql/history.sql +++ b/sql/history.sql @@ -24,7 +24,6 @@ CREATE TABLE IF NOT EXISTS watch_history ( episode_number integer NOT NULL, watch_date DATETIME NOT NULL, CHECK (LENGTH(anime_name) > 0), - CHECK (episode_number > 0), UNIQUE (anime_name, episode_number, watch_date) );