From 5e9f3d8b128309376802c5f5941e88cd8d7426f2 Mon Sep 17 00:00:00 2001 From: Hari Sekhon Date: Wed, 22 Jul 2020 22:09:24 +0100 Subject: [PATCH] updated mp3_set_artist.sh --- mp3_set_artist.sh | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/mp3_set_artist.sh b/mp3_set_artist.sh index a397aeff..f3dde58f 100755 --- a/mp3_set_artist.sh +++ b/mp3_set_artist.sh @@ -43,6 +43,10 @@ artist="$1" shift || : +# used to pipe file list inline which is more comp sci 101 correct but that could create a race condition on second +# evaluation of file list changing after confirmation prompt, and RAM is cheap, so better to use a static list of files +# stored in ram and operate on that since it'll never be that huge anyway + mp3_files="$(for dir in "${@:-$PWD}"; do find "$dir" -maxdepth 2 -iname '*.mp3' || exit 1; done)" if is_blank "$mp3_files"; then