feat: fix a few useless things

This commit is contained in:
g0ldyy
2026-01-07 01:23:33 +01:00
parent 7035b24b3c
commit 1f29c4ca1b
4 changed files with 15 additions and 12 deletions
+8 -8
View File
@@ -27,15 +27,15 @@ async def get_kitsu_metadata(session: aiohttp.ClientSession, id: str):
if end_date and len(end_date) >= 4:
year_end = int(end_date[:4])
if year is None:
created_at = attributes.get("createdAt")
if created_at and len(created_at) >= 4:
year = int(created_at[:4])
# if year is None:
# created_at = attributes.get("createdAt")
# if created_at and len(created_at) >= 4:
# year = int(created_at[:4])
if year_end is None:
updated_at = attributes.get("updatedAt")
if updated_at and len(updated_at) >= 4:
year_end = int(updated_at[:4])
# if year_end is None:
# updated_at = attributes.get("updatedAt")
# if updated_at and len(updated_at) >= 4:
# year_end = int(updated_at[:4])
return title, year, year_end
except Exception as e:
+1 -1
View File
@@ -183,7 +183,7 @@ class MetadataScraper:
aliases = await anime_mapper.get_aliases(full_media_id)
logger.log(
"SCRAPER",
f"📜 Found {len(aliases['ez'])} Anime title aliases for {media_id}",
f"📜 Found {len(aliases.get('ez', []))} Anime title aliases for {media_id}",
)
if aliases:
return aliases
+5 -2
View File
@@ -42,6 +42,7 @@ class AnimeMapper:
def __init__(self):
self.loaded = False
self._refresh_lock = asyncio.Lock()
self._refresh_task = None
self.anime_imdb_ids = set()
self._aod_url = "https://github.com/manami-project/anime-offline-database/releases/latest/download/anime-offline-database-minified.json"
@@ -56,7 +57,9 @@ class AnimeMapper:
await self._load_provider_ids()
if await self._is_cache_stale():
asyncio.create_task(self._refresh_from_remote(background=True))
self._refresh_task = asyncio.create_task(
self._refresh_from_remote(background=True)
)
self.loaded = True
logger.log(
@@ -371,7 +374,7 @@ class AnimeMapper:
except Exception as exc:
logger.error(f"Failed to persist anime mapping cache: {exc}")
return 0, 0
anime_mapper = AnimeMapper()
+1 -1
View File
@@ -266,7 +266,7 @@ class AsyncClientWrapper:
if not self._curl_session:
self._curl_session = CurlSession(
headers=self.headers,
impersonate=self.impersonate or "chrome",
impersonate=self.impersonate,
timeout=self.timeout,
)
return self._curl_session