Compare commits

...

2 Commits

Author SHA1 Message Date
ksyasuda
8902875806 make insert statements blocking to avoid locks 2022-01-21 00:27:39 -08:00
ksyasuda
f40d5d2f91 fix loging bug and update search history list to order by search date 2022-01-19 23:27:25 -08:00
2 changed files with 8 additions and 4 deletions

10
ani-cli
View File

@ -387,8 +387,10 @@ find_media() {
dotdotslash="${inp%/*}"
if [ -z "$dotdotslash" ]; then
find_media "/"
insert_history "directory" "/"
else
find_media "$dotdotslash"
insert_history "directory" "$dotdotslash"
fi
;;
Quit)
@ -398,7 +400,7 @@ find_media() {
if [ ! -d "$inp/$selection" ] && [ ! -f "$inp/$selection" ]; then
return 1
else
insert_history "directory" "$inp/$selection" &
insert_history "directory" "$inp/$selection"
if [ "$inp" = "/" ]; then
find_media "/$selection"
else
@ -418,7 +420,7 @@ get_search_query() {
# Get search history
stmt="SELECT DISTINCT id || '. ' || anime_name \
FROM search_history \
ORDER BY id DESC;"
ORDER BY search_date DESC;"
msg="Choose from list of searched anime below, or enter a unique name of an anime to search for"
span="$(generate_span "$msg")"
@ -655,7 +657,7 @@ open_episode() {
dpage_link=$(get_dpage_link "$anime_id" "$episode")
video_url=$(get_video_quality "$dpage_link")
lg "Download link: $video_url"
lg "Download link: $dpage_link"
lg "Video url: $video_url"
if [ $half_ep -eq 1 ]; then
@ -901,7 +903,7 @@ main() {
file)
lg "STARTING DIR: $play_dir"
[ ! -d "$play_dir" ] && die "$play_dir does not exist"
insert_history "directory" "$play_dir" &
insert_history "directory" "$play_dir"
video_path=$(find_media "$play_dir")
retcode="$?"
if [ "$retcode" -ne 0 ]; then

View File

@ -108,6 +108,8 @@ window {
background-color: var(background);
width: 75%;
border-radius: 12px;
anchor: center;
location: center;
}
mainbox {
padding: 0;