diff --git a/pom.xml b/pom.xml index fe721d1..dc498d9 100644 --- a/pom.xml +++ b/pom.xml @@ -118,7 +118,7 @@ com.fasterxml.jackson.dataformat jackson-dataformat-xml - 2.14.1 + 2.14.2 com.microsoft.playwright diff --git a/src/main/kotlin/fr/jais/scraper/converters/AnimationDigitalNetworkConverter.kt b/src/main/kotlin/fr/jais/scraper/converters/AnimationDigitalNetworkConverter.kt index a6f6216..d601f77 100644 --- a/src/main/kotlin/fr/jais/scraper/converters/AnimationDigitalNetworkConverter.kt +++ b/src/main/kotlin/fr/jais/scraper/converters/AnimationDigitalNetworkConverter.kt @@ -51,26 +51,9 @@ class AnimationDigitalNetworkConverter(private val platform: AnimationDigitalNet val simulcasted = showJson.get("simulcast")?.asBoolean ?: false Logger.config("Simulcasted: $simulcasted") - val calendar = Calendar.getInstance() - val currentDayString = "${calendar.get(Calendar.DAY_OF_WEEK)} ${ - when (calendar.get(Calendar.MONTH)) { - 0 -> "Janvier" - 1 -> "Février" - 2 -> "Mars" - 3 -> "Avril" - 4 -> "Mai" - 5 -> "Juin" - 6 -> "Juillet" - 7 -> "Août" - 8 -> "Septembre" - 9 -> "Octobre" - 10 -> "Novembre" - 11 -> "Décembre" - else -> throw Exception("Invalid month") - } - } ${calendar.get(Calendar.YEAR)}".lowercase() - - if (!simulcasted && description?.lowercase()?.startsWith("(Premier épisode le $currentDayString)".lowercase()) == false) throw NotSimulcastAnimeException("Anime is not simulcasted") + val descriptionLowercase = description?.lowercase() + val isAlternativeSimulcast = descriptionLowercase?.startsWith("(Premier épisode ".lowercase()) == true || descriptionLowercase?.startsWith("(Diffusion des ".lowercase()) == true + if (!simulcasted && !isAlternativeSimulcast) throw NotSimulcastAnimeException("Anime is not simulcasted") return Anime(checkedCountry.getCountry(), name, image, description, genres) }