revert change for now so new episodes can be picked up

This commit is contained in:
ksyasuda 2022-02-20 17:47:16 -08:00
parent 924b0eed76
commit d7bd5899b5

27
ani-cli
View File

@ -475,22 +475,17 @@ search_anime() {
search_eps() { search_eps() {
anime_id=$1 anime_id=$1
if ! check_db "anime" "$anime_id"; then result=$(get_dpage_link "$anime_id" 0)
FIRST_EP_NUMBER="$(run_stmt "SELECT start_episode FROM anime WHERE anime_name = '$anime_id';")" FIRST_EP_NUMBER="${result:-1}"
LAST_EP_NUMBER="$(run_stmt "SELECT end_episode FROM anime WHERE anime_name = '$anime_id';")" LAST_EP_NUMBER=$(curl -s "$BASE_URL/category/$anime_id" |
else sed -n -E '
result=$(get_dpage_link "$anime_id" 0) /^[[:space:]]*<a href="#" class="active" ep_start/{
FIRST_EP_NUMBER="${result:-1}" s/.* '\''([0-9]*)'\'' ep_end = '\''([0-9]*)'\''.*/\2/p
LAST_EP_NUMBER=$(curl -s "$BASE_URL/category/$anime_id" | q
sed -n -E ' }
/^[[:space:]]*<a href="#" class="active" ep_start/{ ')
s/.* '\''([0-9]*)'\'' ep_end = '\''([0-9]*)'\''.*/\2/p # lg "Anime $anime_id not in anime database... inserting into database" > /dev/stderr
q # insert_history "anime" "$anime_id" "$FIRST_EP_NUMBER" "$LAST_EP_NUMBER"
}
')
lg "Anime $anime_id not in anime database... inserting into database" > /dev/stderr
insert_history "anime" "$anime_id" "$FIRST_EP_NUMBER" "$LAST_EP_NUMBER"
fi
FIRST_EP_NUMBER="${FIRST_EP_NUMBER%% }" FIRST_EP_NUMBER="${FIRST_EP_NUMBER%% }"
LAST_EP_NUMBER="${LAST_EP_NUMBER%% }" LAST_EP_NUMBER="${LAST_EP_NUMBER%% }"
lg "FIRST EP NUMBER: $FIRST_EP_NUMBER" lg "FIRST EP NUMBER: $FIRST_EP_NUMBER"