dev: fix SyntaxError global declaration in _trakt_find_in_plugins
global _TRAKT_PLUGIN_MATCH_CACHE_TS muss vor der ersten Verwendung stehen
This commit is contained in:
@@ -257,6 +257,7 @@ def _trakt_find_in_plugins(title: str) -> tuple[str, str] | None:
|
|||||||
Gibt (plugin_name, matched_title) zurueck oder None bei keinem Treffer.
|
Gibt (plugin_name, matched_title) zurueck oder None bei keinem Treffer.
|
||||||
Ergebnisse werden 5 Minuten gecacht (inkl. None-Misses).
|
Ergebnisse werden 5 Minuten gecacht (inkl. None-Misses).
|
||||||
"""
|
"""
|
||||||
|
global _TRAKT_PLUGIN_MATCH_CACHE_TS
|
||||||
if not title:
|
if not title:
|
||||||
return None
|
return None
|
||||||
title_cf = title.casefold()
|
title_cf = title.casefold()
|
||||||
@@ -279,7 +280,6 @@ def _trakt_find_in_plugins(title: str) -> tuple[str, str] | None:
|
|||||||
if result:
|
if result:
|
||||||
break
|
break
|
||||||
with _TRAKT_PLUGIN_MATCH_LOCK:
|
with _TRAKT_PLUGIN_MATCH_LOCK:
|
||||||
global _TRAKT_PLUGIN_MATCH_CACHE_TS
|
|
||||||
_TRAKT_PLUGIN_MATCH_CACHE[title_cf] = result
|
_TRAKT_PLUGIN_MATCH_CACHE[title_cf] = result
|
||||||
_TRAKT_PLUGIN_MATCH_CACHE_TS = now
|
_TRAKT_PLUGIN_MATCH_CACHE_TS = now
|
||||||
return result
|
return result
|
||||||
|
|||||||
Reference in New Issue
Block a user