From 29476235abadf67bdbb10bf9c3fd240538768e52 Mon Sep 17 00:00:00 2001 From: Lucas Berger Date: Sat, 15 Aug 2026 21:28:59 -0400 Subject: [PATCH] Reuse the health check's temp dir instead of orphaning it MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 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) --- plex/bin/plex-health | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/plex/bin/plex-health b/plex/bin/plex-health index eaed72f..a2f546e 100755 --- a/plex/bin/plex-health +++ b/plex/bin/plex-health @@ -203,7 +203,9 @@ check_posters() { local sections sections="$(plex_get /library/sections)" 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 case "$type" in movie) code=1 ;;