From 2ffe55983245a46e33bb1d368325cad033e4cb86 Mon Sep 17 00:00:00 2001 From: "ext.jeremy.guillot@maxicoffee.domains" Date: Fri, 13 Mar 2026 18:08:35 +0100 Subject: [PATCH] fix: MangaDex title fallback + image CDN URL MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - Title: cascade en → fr → ja-ro → ko-ro → zh-ro → first available to avoid silently dropping mangas without English title (e.g. One Piece stored as ja-ro) - Image: use uploads.mangadex.org CDN with .512.jpg thumbnail suffix instead of mangadex.org/covers which fails in prod --- .../Manga/Infrastructure/Provider/MangadexProvider.php | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/src/Domain/Manga/Infrastructure/Provider/MangadexProvider.php b/src/Domain/Manga/Infrastructure/Provider/MangadexProvider.php index 52e63dc..859dcdf 100644 --- a/src/Domain/Manga/Infrastructure/Provider/MangadexProvider.php +++ b/src/Domain/Manga/Infrastructure/Provider/MangadexProvider.php @@ -58,7 +58,12 @@ readonly class MangadexProvider implements MangaProviderInterface { try { $attributes = $result['attributes']; - $title = $attributes['title']['en'] ?? null; + $title = $attributes['title']['en'] + ?? $attributes['title']['fr'] + ?? $attributes['title']['ja-ro'] + ?? $attributes['title']['ko-ro'] + ?? $attributes['title']['zh-ro'] + ?? (!empty($attributes['title']) ? reset($attributes['title']) : null); if (!$title) { return null; @@ -77,7 +82,7 @@ readonly class MangadexProvider implements MangaProviderInterface } if ($relationship['type'] === 'cover_art') { $imageUrl = sprintf( - 'https://mangadex.org/covers/%s/%s', + 'https://uploads.mangadex.org/covers/%s/%s.512.jpg', $result['id'], $relationship['attributes']['fileName'] );