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

Commit

Permalink
Merge pull request #62 from Z-Jais/master
Browse files Browse the repository at this point in the history
Update and fix bugs
  • Loading branch information
Ziedelth authored Jan 31, 2023
2 parents 29343c0 + 88c4490 commit 4141357
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 21 deletions.
2 changes: 1 addition & 1 deletion pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -118,7 +118,7 @@
<dependency>
<groupId>com.fasterxml.jackson.dataformat</groupId>
<artifactId>jackson-dataformat-xml</artifactId>
<version>2.14.1</version>
<version>2.14.2</version>
</dependency>
<dependency>
<groupId>com.microsoft.playwright</groupId>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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)
}
Expand Down

0 comments on commit 4141357

Please sign in to comment.