mirror of
https://github.com/ksyasuda/aniwrapper.git
synced 2024-11-22 03:19:53 -08:00
update highlighting and play first episode automatically (#20)
This commit is contained in:
parent
64d70c34f2
commit
3117738f27
9
ani-cli
9
ani-cli
@ -606,7 +606,9 @@ main() {
|
|||||||
anime_name="${updated_episode%%/*}"
|
anime_name="${updated_episode%%/*}"
|
||||||
lg "ANIME NAME: $anime_name"
|
lg "ANIME NAME: $anime_name"
|
||||||
if ! check_db "search" "$anime_name"; then
|
if ! check_db "search" "$anime_name"; then
|
||||||
stmt="SELECT COUNT(*) FROM search_history WHERE anime_name = '$anime_name';"
|
ep="${updated_episode##*/ep}"
|
||||||
|
[ "$ep" = "$anime_name" ] && ep=1
|
||||||
|
stmt="SELECT COUNT(*) FROM watch_history WHERE anime_name = '$anime_name' AND episode_number = '${ep:-1}';"
|
||||||
lg "QUERY: $stmt"
|
lg "QUERY: $stmt"
|
||||||
if [[ "$(run_stmt "$stmt")" -ne 0 ]]; then
|
if [[ "$(run_stmt "$stmt")" -ne 0 ]]; then
|
||||||
lg "$updated_episode watched before... adding to watched list"
|
lg "$updated_episode watched before... adding to watched list"
|
||||||
@ -623,8 +625,11 @@ main() {
|
|||||||
fi
|
fi
|
||||||
lg "SELECTION: $selection"
|
lg "SELECTION: $selection"
|
||||||
selection_id="${selection%%/*}"
|
selection_id="${selection%%/*}"
|
||||||
|
anime_id="$selection_id"
|
||||||
episode_list "$selection_id"
|
episode_list "$selection_id"
|
||||||
get_episode
|
ep_choice_start="${selection##*/ep}"
|
||||||
|
lg "EP_CHOICE_START: $ep_choice_start"
|
||||||
|
[ "$ep_choice_start" = "$selection_id" ] && get_episode
|
||||||
;;
|
;;
|
||||||
esac
|
esac
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user