From 89028758064b7fb9af2d2025486a168318e24638 Mon Sep 17 00:00:00 2001 From: ksyasuda Date: Fri, 21 Jan 2022 00:27:39 -0800 Subject: [PATCH] make insert statements blocking to avoid locks --- ani-cli | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/ani-cli b/ani-cli index b57f7eb..fccec49 100755 --- a/ani-cli +++ b/ani-cli @@ -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 @@ -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