feat: anime mapping disabler

This commit is contained in:
itzme
2026-01-08 09:53:19 +01:00
parent d4d7e6091c
commit 1c0bf9bcc4
5 changed files with 18 additions and 7 deletions
+3
View File
@@ -92,6 +92,9 @@ CATALOG_TIMEOUT=30 # Max time to fetch catalog pages (seconds)
# ============================== #
# Anime Mapping Configuration #
# ============================== #
# Anime Mapping is used to match IMDb/Kitsu IDs to Anime specific IDs (AniList, MAL, Kitsu, etc.) to retrieve title aliases.
# This greatly improves title matching performances for anime content by using accurate alternative titles.
ANIME_MAPPING_ENABLED=True
ANIME_MAPPING_REFRESH_INTERVAL=432000 # Seconds between background anime mapping refreshes when using database cache (<=0 disables)
# ============================== #
+1 -5
View File
@@ -519,11 +519,7 @@ async def stream(
torrent = torrents[info_hash]
rtn_data = torrent["parsed"]
debrid_emoji = (
"🧲"
if is_torrent
else ("⚡" if torrent["cached"] else "⬇️")
)
debrid_emoji = "🧲" if is_torrent else ("⚡" if torrent["cached"] else "⬇️")
torrent_title = torrent["title"]
formatted_components = get_formatted_components(
+6 -1
View File
@@ -214,9 +214,14 @@ def log_startup_info(settings):
"Use PostgreSQL for reliable background scraping."
)
anime_mapping_refresh = (
f" - Refresh Interval: {settings.ANIME_MAPPING_REFRESH_INTERVAL}s"
if settings.ANIME_MAPPING_ENABLED
else ""
)
logger.log(
"COMET",
f"Anime Mapping Refresh Interval: {settings.ANIME_MAPPING_REFRESH_INTERVAL}s",
f"Anime Mapping: {settings.ANIME_MAPPING_ENABLED}{anime_mapping_refresh}",
)
logger.log(
+1
View File
@@ -128,6 +128,7 @@ class AppSettings(BaseSettings):
BACKGROUND_SCRAPER_INTERVAL: Optional[int] = 3600
BACKGROUND_SCRAPER_MAX_MOVIES_PER_RUN: Optional[int] = 100
BACKGROUND_SCRAPER_MAX_SERIES_PER_RUN: Optional[int] = 100
ANIME_MAPPING_ENABLED: Optional[bool] = True
ANIME_MAPPING_REFRESH_INTERVAL: Optional[int] = 432000
DIGITAL_RELEASE_FILTER: Optional[bool] = False
TMDB_READ_ACCESS_TOKEN: Optional[str] = None
+7 -1
View File
@@ -49,6 +49,9 @@ class AnimeMapper:
self._fribb_url = "https://raw.githubusercontent.com/Fribb/anime-lists/refs/heads/master/anime-list-full.json"
async def load_anime_mapping(self, session: aiohttp.ClientSession | None = None):
if not settings.ANIME_MAPPING_ENABLED:
return True
if self.loaded:
return True
@@ -70,7 +73,10 @@ class AnimeMapper:
return await self._refresh_from_remote(session)
def is_anime_content(self, media_id: str, media_only_id: str):
if not self.loaded:
if not settings.ANIME_MAPPING_ENABLED:
return False
if not self.loaded: # to prevent blocking anime-only scrapers
return True
provider, provider_id = self._parse_media_id(media_id)