mirror of
https://github.com/ksyasuda/aniwrapper.git
synced 2024-10-28 04:44:11 -07:00
Compare commits
3 Commits
505e5125b9
...
6dd2b4c279
Author | SHA1 | Date | |
---|---|---|---|
|
6dd2b4c279 | ||
|
04476f3ba4 | ||
|
d061438e2e |
10
ani-cli
10
ani-cli
@ -678,7 +678,11 @@ episode_selection() {
|
||||
# Get Watch History for $anime_id as comma separated list
|
||||
watch_history=""
|
||||
while read -r i; do
|
||||
[[ -z "$watch_history" ]] && watch_history="$((--i))" || watch_history="$watch_history, $((--i))"
|
||||
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
|
||||
done < <(run_stmt "$stmt")
|
||||
lg "Episode watch history -> $watch_history"
|
||||
|
||||
@ -706,7 +710,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
|
||||
}
|
||||
@ -794,7 +798,7 @@ stream() {
|
||||
die "No anime selection found"
|
||||
fi
|
||||
fi
|
||||
if (((FIRST_EP_NUMBER == LAST_EP_NUMBER && FIRST_EP_NUMBER == 1))); then
|
||||
if (((FIRST_EP_NUMBER == LAST_EP_NUMBER && (FIRST_EP_NUMBER == 0 || FIRST_EP_NUMBER == 1)))); then
|
||||
ep_choice_start=1
|
||||
else
|
||||
episode_selection
|
||||
|
@ -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)
|
||||
);
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user