From a41011ae173eede834bc21005479991e0930f6dd Mon Sep 17 00:00:00 2001 From: Codex Date: Mon, 10 Aug 2026 11:10:45 +0200 Subject: [PATCH] Clean up retired metadata path --- CHANGELOG.md | 5 +++++ README.md | 1 + VERSION | 2 +- app.py | 41 ++++------------------------------------- app_support.py | 4 ---- test_app.py | 8 ++++++++ 6 files changed, 19 insertions(+), 42 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index cb2c12d..7d14858 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,10 @@ # Changelog +## 0.52.9 - 2026-08-10 + +- Removed the unused legacy AllManga/AllAnime GraphQL metadata helper and constants from active code. +- Logged best-effort Watchlist thumbnail refresh failures instead of silently swallowing them. + ## 0.52.8 - 2026-08-09 - Added default Docker Jellyfin TV and movie mount points at `/jellyfin/tv` and `/jellyfin/movies`. diff --git a/README.md b/README.md index 4032ce9..1ae6ec4 100644 --- a/README.md +++ b/README.md @@ -7,6 +7,7 @@ Kaizoku is a local web app for searching, tracking, and downloading anime from A - Search anime through the configured provider and tag results with available `SUB` and `DUB` episode languages. - Choose the active search provider directly from the Search page. - Prefer provider-supplied search artwork, with a local title-based thumbnail fallback when provider artwork is missing or broken. +- Fill Watchlist thumbnails from AnimeSchedule or AniDB title metadata when provider artwork is missing. - Queue single episodes or batches in subbed or dubbed mode. - Monitor active Queue jobs with per-episode progress, segment counts, and live downloader output. - Open result actions in a floating window for watchlist, media type, subbed/dubbed mode, library name, season, episode range, and download folder choices. diff --git a/VERSION b/VERSION index 6e3eb02..e26415d 100644 --- a/VERSION +++ b/VERSION @@ -1 +1 @@ -0.52.8 +0.52.9 diff --git a/app.py b/app.py index 16f891a..3f5436c 100644 --- a/app.py +++ b/app.py @@ -35,8 +35,6 @@ from app_support import ( CONFIG_PATH, DEFAULT_CONFIG, MAX_JSON_BODY_BYTES, - METADATA_API, - METADATA_REFERER, MODE_CHOICES, QUALITY_CHOICES, send_discord_webhook_event, @@ -101,37 +99,6 @@ WATCHLIST_JELLYFIN_SYNC = None WATCHLIST_BACKUP_FORMAT_VERSION = 1 -def graph_request(query, variables, timeout=25): - payload = json.dumps({"variables": variables, "query": query}).encode("utf-8") - request = urllib.request.Request( - f"{METADATA_API}/api", - data=payload, - headers={ - "Content-Type": "application/json", - "Referer": METADATA_REFERER, - "User-Agent": AGENT, - }, - method="POST", - ) - try: - with urllib.request.urlopen(request, timeout=timeout) as response: - raw = response.read().decode("utf-8") - except urllib.error.URLError as exc: - raise RuntimeError(f"Could not reach metadata service: {exc}") from exc - except TimeoutError as exc: - raise RuntimeError("Metadata request timed out") from exc - - try: - data = json.loads(raw) - except json.JSONDecodeError as exc: - raise RuntimeError("Metadata service returned an unreadable response") from exc - - if data.get("errors"): - message = data["errors"][0].get("message", "Metadata service returned an error") - raise RuntimeError(message) - return data.get("data", {}) - - def parse_iso_timestamp(value): text = str(value or "").strip() if not text: @@ -2209,8 +2176,8 @@ class WatchlistStore: if include_thumbnail and self.has_show(normalized_show_id): try: self.ensure_thumbnail(normalized_show_id) - except Exception: - pass + except Exception as exc: + debug_log("watchlist.refresh.thumbnail_failed", show_id=normalized_show_id, error=exc) item = self.get(normalized_show_id) item["previous_sub_count"] = previous_sub_count item["previous_dub_count"] = previous_dub_count @@ -2802,8 +2769,8 @@ class WatchlistStore: continue try: self.ensure_thumbnail(show_id, force=force) - except Exception: - pass + except Exception as exc: + debug_log("watchlist.ensure_thumbnails.failed", show_id=show_id, error=exc) try: updated.append(self.get(show_id)) except KeyError: diff --git a/app_support.py b/app_support.py index 25b16b3..88f12e9 100644 --- a/app_support.py +++ b/app_support.py @@ -41,10 +41,6 @@ KAIZOKU_DOWNLOADER = configured_cli_command("KAIZOKU_DOWNLOADER_BIN", "provider_ APP_NAME = "Kaizoku" VERSION_FILE = PROJECT_ROOT / "VERSION" CHANGELOG_FILE = PROJECT_ROOT / "CHANGELOG.md" -METADATA_API_HOST = "allanime.day" -METADATA_API = f"https://api.{METADATA_API_HOST}" -METADATA_REFERER = "https://allmanga.to" -METADATA_SITE_BASE = "https://allmanga.to" ANIMESCHEDULE_API = "https://animeschedule.net/api/v3" ANIMESCHEDULE_IMAGE_BASE = "https://img.animeschedule.net/production/assets/public/img/" ANIDB_TITLES_URL = "https://anidb.net/api/anime-titles.xml.gz" diff --git a/test_app.py b/test_app.py index 0454606..5f2048b 100644 --- a/test_app.py +++ b/test_app.py @@ -4090,6 +4090,14 @@ class TemplateHelperTests(unittest.TestCase): self.assertIn("mkdir -p /downloads /jellyfin/tv /jellyfin/movies /app/.kaizoku", dockerfile) self.assertIn("chown \"$uid:$gid\" /downloads /jellyfin/tv /jellyfin/movies", entrypoint) + def test_active_code_does_not_reference_retired_metadata_source(self): + active_files = ("app.py", "app_support.py", "http_handler.py", "provider_bridge.py", "provider_downloader.py") + active_text = "\n".join((ROOT / filename).read_text(encoding="utf-8") for filename in active_files) + + self.assertNotIn("allmanga", active_text.lower()) + self.assertNotIn("allanime", active_text.lower()) + self.assertNotIn("METADATA_API", active_text) + def test_queue_page_formats_jellyfin_handoff_jobs(self): self.assertIn('job.job_type === "jellyfin_handoff"', APP.QUEUE_HTML) self.assertIn('const progress = `${job.completed || 0}/${job.total || 0} entries`;', APP.QUEUE_HTML)