mirror of
https://github.com/g0ldyy/comet.git
synced 2026-01-12 01:16:12 +01:00
feat: anime mapping disabler
This commit is contained in:
@@ -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)
|
||||
|
||||
# ============================== #
|
||||
|
||||
@@ -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(
|
||||
|
||||
@@ -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(
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -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)
|
||||
|
||||
Reference in New Issue
Block a user