From 77845829ad8cf1ea101d24efa39e2790bcd292bb Mon Sep 17 00:00:00 2001 From: Gmer4Lfe Date: Sat, 18 Jul 2026 16:50:33 -0400 Subject: [PATCH] Add --filter to arr_corruption_scan.sh for targeted testing MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Full-library scans are slow to reach any one show by chance — this lets a test target a specific known-corrupt file/show without waiting on scan order. --- Arrs_Stack/arr_corruption_scan.sh | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/Arrs_Stack/arr_corruption_scan.sh b/Arrs_Stack/arr_corruption_scan.sh index 6a2bc13..ffcf0f3 100755 --- a/Arrs_Stack/arr_corruption_scan.sh +++ b/Arrs_Stack/arr_corruption_scan.sh @@ -79,6 +79,9 @@ # useful for a bounded first test) # arr_corruption_scan.sh --log — verbose (prints every clean file too) # arr_corruption_scan.sh --status — show config and exit +# arr_corruption_scan.sh --filter=Becker — only consider paths containing this substring +# (testing/targeting a specific show; state +# file and everything else behaves normally) # # ============================================================================================== @@ -90,10 +93,12 @@ source "$SCRIPT_DIR/../load_config.sh" # before they get filtered. REMEDIATE=false SCAN_LIMIT=0 +PATH_FILTER="" for _arg in "$@"; do case "$_arg" in --remediate) REMEDIATE=true ;; --limit=*) SCAN_LIMIT="${_arg#*=}" ;; + --filter=*) PATH_FILTER="${_arg#*=}" ;; esac done unset _arg @@ -171,6 +176,7 @@ if [[ "$SHOW_STATUS" == true ]]; then echo "$ICON_GEAR State file: $CORRUPTION_SCAN_STATE_FILE" echo "$ICON_GEAR Remediate: $REMEDIATE" echo "$ICON_GEAR Scan limit: ${SCAN_LIMIT:-unlimited}" + echo "$ICON_GEAR Path filter: ${PATH_FILTER:-none}" echo "━━━━━━━━━━━━━━━━━━━━━━━" exit 0 fi @@ -287,6 +293,7 @@ while IFS= read -r item; do host_path=$(translate_path "$api_path") [[ -f "$host_path" ]] || continue + [[ -n "$PATH_FILTER" && "$host_path" != *"$PATH_FILTER"* ]] && continue stamp="$(stat -c '%Y:%s' "$host_path" 2>/dev/null)" [[ -z "$stamp" ]] && continue