Compare commits

..

3 Commits

Author SHA1 Message Date
ksyasuda
7a3a61bb58 run insert queries in background before search_eps function 2022-02-20 20:00:25 -08:00
ksyasuda
f95ae51af8 check exit code directly in update_date function 2022-02-20 19:57:40 -08:00
ksyasuda
8fb570b003 simplify logic in find_media function 2022-02-20 19:11:14 -08:00

18
ani-cli
View File

@ -245,9 +245,7 @@ update_date() {
insert_history() {
datetime=$(date +'%Y-%m-%d %H:%M:%S')
lg "Checking if ($*) exists in db"
check_db "$@"
res="$?"
if [[ $res -gt 0 ]]; then
if ! check_db "$@"; then
lg "Match found... Updating row in history db..."
update_date "$@"
res=$?
@ -408,13 +406,9 @@ find_media() {
case "$selection" in
Back | ../)
dotdotslash="${inp%/*}"
if [ -z "$dotdotslash" ]; then
insert_history "directory" "/"
find_media "/"
else
insert_history "directory" "$dotdotslash"
find_media "$dotdotslash"
fi
[ -z "$dotdotslash" ] && dotdotslash="/"
insert_history "directory" "$dotdotslash"
find_media "$dotdotslash"
;;
Quit)
return 1
@ -545,7 +539,7 @@ anime_selection() {
done <<< "$search_results"
[[ -z "$selection_id" ]] && die "Invalid number entered"
insert_history "search" "$selection_id"
insert_history "search" "$selection_id" &
lg "Selection: $selection_id"
search_eps "$anime_id"
return 0
@ -694,7 +688,7 @@ stream() {
fi
else
selection_id="$anime_id"
insert_history "search" "$anime_id"
insert_history "search" "$anime_id" &
search_eps "$anime_id"
fi
episode_selection