Skip to content
This repository has been archived by the owner on Mar 11, 2024. It is now read-only.

Fix ADN Genre #194

Merged
merged 1 commit into from
Jan 5, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -55,8 +55,6 @@ class AnimationDigitalNetworkConverter(private val platform: AnimationDigitalNet
val genres = showJson.getAsJsonArray("genres")?.mapNotNull { it.asString() } ?: emptyList()
Logger.config("Genres: ${genres.joinToString(", ")}")

if (!genres.any { it.startsWith("Animation ", true) }) throw NotJapaneseAnimeException("Show is not an anime")

// ----- SIMULCAST -----
Logger.info("Checking if anime is simulcasted...")
val simulcasted =
Expand All @@ -65,10 +63,11 @@ class AnimationDigitalNetworkConverter(private val platform: AnimationDigitalNet

val descriptionLowercase = description?.lowercase()
val isAlternativeSimulcast =
whitelistAnimes.contains(name) || (descriptionLowercase?.startsWith("(Premier épisode ".lowercase()) == true ||
descriptionLowercase?.startsWith("(Diffusion des ".lowercase()) == true ||
descriptionLowercase?.startsWith("(Diffusion du premier épisode".lowercase()) == true ||
descriptionLowercase?.startsWith("(Diffusion de l'épisode 1 le".lowercase()) == true)
(whitelistAnimes.contains(name) || genres.any { it.startsWith("Animation ", true) }) ||
(descriptionLowercase?.startsWith("(Premier épisode ".lowercase()) == true ||
descriptionLowercase?.startsWith("(Diffusion des ".lowercase()) == true ||
descriptionLowercase?.startsWith("(Diffusion du premier épisode".lowercase()) == true ||
descriptionLowercase?.startsWith("(Diffusion de l'épisode 1 le".lowercase()) == true)

if (!simulcasted && !isAlternativeSimulcast) throw NotSimulcastAnimeException("Anime is not simulcasted")

Expand Down