themes and various bugs

This commit is contained in:
Finnley Somdahl 2023-10-24 23:38:46 -05:00
parent dc165fa6bc
commit 63526c6ed3
114 changed files with 1719 additions and 558 deletions

View file

@ -32,8 +32,10 @@ abstract class AnimeParser : BaseParser() {
* Returns null, if no latest episode is found.
* **/
open suspend fun getLatestEpisode(animeLink: String, extra: Map<String, String>?, sAnime: SAnime, latest: Float): Episode?{
return loadEpisodes(animeLink, extra, sAnime)
val episodes = loadEpisodes(animeLink, extra, sAnime)
val max = episodes
.maxByOrNull { it.number.toFloatOrNull()?:0f }
return max
?.takeIf { latest < (it.number.toFloatOrNull() ?: 0.001f) }
}