Compare commits

..

No commits in common. "6dd2b4c27941cad88b4d31b279fab0707a789bd0" and "505e5125b9e9d0147c0c102d101b7c83b702b548" have entirely different histories.

2 changed files with 4 additions and 7 deletions

10
ani-cli
View File

@ -678,11 +678,7 @@ episode_selection() {
# Get Watch History for $anime_id as comma separated list
watch_history=""
while read -r i; do
if ((FIRST_EP_NUMBER == 0)); then
[[ -z "$watch_history" ]] && watch_history="$((i))" || watch_history="$watch_history, $((i))"
else
[[ -z "$watch_history" ]] && watch_history="$((--i))" || watch_history="$watch_history, $((--i))"
fi
[[ -z "$watch_history" ]] && watch_history="$((--i))" || watch_history="$watch_history, $((--i))"
done < <(run_stmt "$stmt")
lg "Episode watch history -> $watch_history"
@ -710,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
}
@ -798,7 +794,7 @@ stream() {
die "No anime selection found"
fi
fi
if (((FIRST_EP_NUMBER == LAST_EP_NUMBER && (FIRST_EP_NUMBER == 0 || FIRST_EP_NUMBER == 1)))); then
if (((FIRST_EP_NUMBER == LAST_EP_NUMBER && FIRST_EP_NUMBER == 1))); then
ep_choice_start=1
else
episode_selection

View File

@ -24,6 +24,7 @@ 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)
);