allow episode 0

This commit is contained in:
ksyasuda 2022-04-25 19:30:38 -07:00
parent 505e5125b9
commit d061438e2e
2 changed files with 1 additions and 2 deletions

View File

@ -706,7 +706,7 @@ episode_selection() {
read -r ep_choice_start ep_choice_end read -r ep_choice_start ep_choice_end
[[ -z "$ep_choice_end" ]] && ep_choice_end="$ep_choice_start" [[ -z "$ep_choice_end" ]] && ep_choice_end="$ep_choice_start"
fi 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" die "Invalid episode/range entered: ep_start -> $ep_choice_start | ep_end -> $ep_choice_end"
fi fi
} }

View File

@ -24,7 +24,6 @@ CREATE TABLE IF NOT EXISTS watch_history (
episode_number integer NOT NULL, episode_number integer NOT NULL,
watch_date DATETIME NOT NULL, watch_date DATETIME NOT NULL,
CHECK (LENGTH(anime_name) > 0), CHECK (LENGTH(anime_name) > 0),
CHECK (episode_number > 0),
UNIQUE (anime_name, episode_number, watch_date) UNIQUE (anime_name, episode_number, watch_date)
); );