66########################################################################
77
88"""
9- DKSubs NFO-Hunter Proxy v5.6
9+ DKSubs NFO-Hunter Proxy v6.0
1010==============================
1111Universal Translator: Extended-attr enrichment for both NFO and enrich-only
12- indexers, plus v5.6 API-spend reduction layers (request dedup with
12+ indexers, plus v6.0 API-spend reduction layers (request dedup with
1313single-flight lock, movie-verdict cache, cross-indexer release-name dedup +
1414NFO early-exit, per-indexer NFO budget scaled by rolling hit-rate).
1515
16- All v5.6 layers are individually env-flag gated, with DKSUBS_PROXY_V56_FEATURES=0
16+ All v6.0 layers are individually env-flag gated, with DKSUBS_PROXY_V56_FEATURES=0
1717as the global kill switch that reverts to v5.5 behavior.
1818"""
1919
4242load_dotenv () # /app/.env when running under `docker compose` w/ env_file
4343load_dotenv ("/config/.env" , override = True ) # /config/.env when installed via Cosmos Market (bind mount)
4444
45- VERSION = "5.6 "
45+ VERSION = "6.0 "
4646
4747PROWLARR_URL = os .getenv ("PROWLARR_URL" , "http://Prowlarr:9696" ).rstrip ("/" )
4848PROWLARR_API_KEY = os .getenv ("PROWLARR_API_KEY" , "" )
@@ -116,7 +116,7 @@ def probe_score(title: str, indexer_id: str,
116116 Components:
117117 + 5.0 for subs_from_title (NORDiC etc. matched the title)
118118 + 3.0 for a strong multi-audio scene-group signal in the title
119- + indexer_hit_rate × 2.0 (existing v5.6 per-indexer score)
119+ + indexer_hit_rate × 2.0 (existing v6.0 per-indexer score)
120120 - per-indexer cost penalty (default 1.0)
121121 """
122122 score = 0.0
@@ -131,7 +131,7 @@ def probe_score(title: str, indexer_id: str,
131131
132132DEBUG_LOGGING = os .getenv ("DEBUG_LOGGING" , os .getenv ("DEBUG" , "0" )) == "1"
133133
134- # ── v5.6 feature flags ───────────────────────────────────────────────────────
134+ # ── v6.0 feature flags ───────────────────────────────────────────────────────
135135# All flags can be disabled individually by setting to 0/false. The global
136136# DKSUBS_PROXY_V56_FEATURES kill switch overrides them all when set to 0.
137137
@@ -186,7 +186,7 @@ def _max_nfo_candidates(indexer_id: str) -> int:
186186 "requests_total" : 0 , "hunt_total" : 0 , "dk_hits" : 0 , "nfo_fetches" : 0 ,
187187 "nfo_direct_fetches" : 0 , "nfo_direct_hits" : 0 ,
188188 "cache_hits" : 0 , "cache_misses" : 0 , "upstream_errors" : 0 , "hunt_errors" : 0 ,
189- # v5.6 metrics
189+ # v6.0 metrics
190190 "dedup_hits" : 0 , "dedup_inflight_waits" : 0 ,
191191 "verdict_suppressions" : 0 , "verdict_writes" : 0 ,
192192 "indexer_score_demotions" : 0 , "nfo_early_exits" : 0 ,
@@ -276,7 +276,7 @@ def log(msg: str, level: str = "INFO") -> None:
276276
277277ATTR_DK_RE = re .compile (r"\b(danish|dansk|nordic|dan|da)\b" , re .I )
278278
279- # ── v5.6 Layer 3: release-name normalization for cross-indexer dedup ─────────
279+ # ── v6.0 Layer 3: release-name normalization for cross-indexer dedup ─────────
280280_PROXY_TAG_RE = re .compile (r'\.(DKOK|DKaudio)\b' , re .I )
281281_EXT_RE = re .compile (r'\.(mkv|mp4|avi|nfo|nzb)$' , re .I )
282282_WS_RE = re .compile (r'\s+' )
0 commit comments