Bring script headers onto the template and close safeguard gaps

Headers claimed protections the code never had, and several destructive paths had no
guard against a collapsed config value.
This commit is contained in:
Gmer4Lfe
2026-08-01 20:37:59 -04:00
parent cdce877601
commit e8b114094a
78 changed files with 3301 additions and 277 deletions
+19 -4
View File
@@ -16,7 +16,7 @@
# Goal: 05 meaningful Lidarr adds per week, not bulk imports.
#
# ==============================================================================================
# FLOW
# OPERATIONAL MODEL
# ==============================================================================================
#
# 1. Fetch play completions from Emby activity log (last LOOKBACK_DAYS days)
@@ -58,11 +58,26 @@
# Max adds: LIDARR_DISCOVERY_MAX_ADDS (default 5) caps each stage
#
# ==============================================================================================
# REQUIREMENTS
# CONFIGURATION
# ==============================================================================================
#
# Last.fm API key — required for both stages
# Configure HOST*_LASTFM_API_KEY in host*.conf
# host*.conf (aliased by detect_hosts())
#
# HOST*_LASTFM_API_KEY Required for both stages — without it the run exits cleanly
# rather than adding anything unscored.
# LIDARR_URL / LIDARR_API_KEY Target arr
# EMBY_URL / EMBY_API_KEY Play history source for seed selection
#
# master.conf
#
# LIDARR_DISCOVERY_THRESHOLD Score required to accept a candidate (0-100)
# LIDARR_DISCOVERY_LOOKBACK_DAYS Emby play history window
# LIDARR_DISCOVERY_MIN_PLAYS Min plays in the window before an artist is evaluated
# LIDARR_DISCOVERY_USER_CAP_PCT Max % of the play score any one user can contribute,
# so a single heavy listener cannot drive the library
# LIDARR_DISCOVERY_MAX_ADDS Hard cap on artists added per run
# LIDARR_DISCOVERY_REJECT_COOLDOWN Days before a rejected artist is re-evaluated
# LIDARR_DISCOVERY_HISTORY Decision history DB — accepted and rejected
#
# ==============================================================================================
# DESIGN PRINCIPLES