Reuse the health check's temp dir instead of orphaning it

check_posters unconditionally re-made WORKDIR, so when check_unmatched had
already created one the first was left behind — cleanup only removes the last.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
This commit is contained in:
Lucas Berger
2026-08-15 21:28:59 -04:00
co-authored by Claude Opus 5
parent 829bf009df
commit 29476235ab
+3 -1
View File
@@ -203,7 +203,9 @@ check_posters() {
local sections local sections
sections="$(plex_get /library/sections)" sections="$(plex_get /library/sections)"
local key title type code bad total local key title type code bad total
WORKDIR="$(mktemp -d)" # Reuse the dir check_unmatched may already have made; overwriting WORKDIR
# here would orphan it, since cleanup only removes the last one.
[[ -n "$WORKDIR" ]] || WORKDIR="$(mktemp -d)"
while IFS=$'\t' read -r key title type; do while IFS=$'\t' read -r key title type; do
case "$type" in case "$type" in
movie) code=1 ;; movie) code=1 ;;