From 3cec4558d252cc20b769cfec76671f36d0e555fc Mon Sep 17 00:00:00 2001 From: ksyasuda Date: Sat, 22 Jan 2022 11:13:41 -0800 Subject: [PATCH] fix some corner cases with play from file --- ani-cli | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/ani-cli b/ani-cli index 6844fcd..51d905b 100755 --- a/ani-cli +++ b/ani-cli @@ -381,31 +381,31 @@ find_media() { selection="$(rofi -dpi "$DPI" -dmenu -only-match -async-pre-read 33 -config "$ROFI_CFG" \ -l 15 -i -sep '|' -mesg "$(generate_span "Current directory: $inp")" -a "$watched" \ -p "Enter selection" <<< "$inputlist")" - + lg "SELECTION: $selection" 1> /dev/stderr case "$selection" in Back | ../) dotdotslash="${inp%/*}" if [ -z "$dotdotslash" ]; then - find_media "/" insert_history "directory" "/" + find_media "/" else - find_media "$dotdotslash" insert_history "directory" "$dotdotslash" + find_media "$dotdotslash" fi ;; Quit) return 1 ;; *) - if [ ! -d "$inp/$selection" ] && [ ! -f "$inp/$selection" ]; then - return 1 - else + if [ -d "$inp/$selection" ]; then insert_history "directory" "$inp/$selection" if [ "$inp" = "/" ]; then find_media "/$selection" else find_media "$inp/$selection" fi + else + find_media "$inp/$selection" fi ;; esac