From d83a6f4a37083481d083130a8c67c617dc762538 Mon Sep 17 00:00:00 2001 From: mkelvers Date: Sat, 2 May 2026 17:07:05 +0200 Subject: [PATCH] debug: force fallback for code geass ep 6 --- integrations/jikan/episodes.go | 15 ++++++++------- 1 file changed, 8 insertions(+), 7 deletions(-) diff --git a/integrations/jikan/episodes.go b/integrations/jikan/episodes.go index 7b09d5d..94674af 100644 --- a/integrations/jikan/episodes.go +++ b/integrations/jikan/episodes.go @@ -22,12 +22,7 @@ func (e *Episode) GetFallbackImage(animeID int) string { imageUrl = e.Images.Jpg.ImageURL } - // Always trigger scraping if we encounter the banned icon OR the generic placeholder - if imageUrl != bannedImageURL && imageUrl != placeholderImageURL && imageUrl != "" { - return imageUrl - } - - // Determine the episode number reliably + // Determining the episode number reliably. Jikan's Episode string can be "Episode 1" or just "1" episodeNum := 0 if e.Episode != "" { re := regexp.MustCompile(`\d+`) @@ -37,11 +32,17 @@ func (e *Episode) GetFallbackImage(animeID int) string { } } - // Fallback to MalID if the episode string didn't have a number + // For Video episodes, MalID is often the episode number, but let's check if episodeNum == 0 { episodeNum = e.MalID } + // Always trigger scraping if we encounter the banned icon OR the generic placeholder + // OR if it's the specific Code Geass episode we are testing + if imageUrl != bannedImageURL && imageUrl != placeholderImageURL && imageUrl != "" && !(animeID == 2904 && episodeNum == 6) { + return imageUrl + } + episodeURL := fmt.Sprintf("https://myanimelist.net/anime/%d/episode/%d", animeID, episodeNum) fallbackURL := scrapeAnimeImageFromEpisodePage(episodeURL, episodeNum)