diff --git a/app/src/main/java/ani/dantotsu/parsers/OfflineAnimeParser.kt b/app/src/main/java/ani/dantotsu/parsers/OfflineAnimeParser.kt index 85d1af9089..f8ae2e54c2 100644 --- a/app/src/main/java/ani/dantotsu/parsers/OfflineAnimeParser.kt +++ b/app/src/main/java/ani/dantotsu/parsers/OfflineAnimeParser.kt @@ -55,13 +55,11 @@ class OfflineAnimeParser : AnimeParser() { episodes.add(episode) } } - //episodes.sortBy { MediaNameAdapter.findEpisodeNumber(it.number) } - episodes.addAll(loadEpisodesCompat(animeLink, extra, sAnime)) - //filter those with the same name - return episodes.distinctBy { it.number } - .sortedBy { MediaNameAdapter.findEpisodeNumber(it.number) } } - return emptyList() + episodes.addAll(loadEpisodesCompat(animeLink, extra, sAnime)) + //filter those with the same name + return episodes.distinctBy { it.number } + .sortedBy { MediaNameAdapter.findEpisodeNumber(it.number) } } override suspend fun loadVideoServers( diff --git a/app/src/main/java/ani/dantotsu/parsers/OfflineMangaParser.kt b/app/src/main/java/ani/dantotsu/parsers/OfflineMangaParser.kt index f0c1237f97..ec3ca338fe 100644 --- a/app/src/main/java/ani/dantotsu/parsers/OfflineMangaParser.kt +++ b/app/src/main/java/ani/dantotsu/parsers/OfflineMangaParser.kt @@ -43,11 +43,10 @@ class OfflineMangaParser : MangaParser() { chapters.add(chapter) } } - chapters.addAll(loadChaptersCompat(mangaLink, extra, sManga)) - return chapters.distinctBy { it.number } - .sortedBy { MediaNameAdapter.findChapterNumber(it.number) } } - return emptyList() + chapters.addAll(loadChaptersCompat(mangaLink, extra, sManga)) + return chapters.distinctBy { it.number } + .sortedBy { MediaNameAdapter.findChapterNumber(it.number) } } override suspend fun loadImages(chapterLink: String, sChapter: SChapter): List { @@ -66,17 +65,16 @@ class OfflineMangaParser : MangaParser() { for (image in images) { Logger.log("imageNumber: ${image.url.url}") } - return if (images.isNotEmpty()) { - images.sortBy { image -> - val matchResult = imageNumberRegex.find(image.url.url) - matchResult?.groups?.get(1)?.value?.toIntOrNull() ?: Int.MAX_VALUE - } - images - } else { - loadImagesCompat(chapterLink, sChapter) + } + return if (images.isNotEmpty()) { + images.sortBy { image -> + val matchResult = imageNumberRegex.find(image.url.url) + matchResult?.groups?.get(1)?.value?.toIntOrNull() ?: Int.MAX_VALUE } + images + } else { + loadImagesCompat(chapterLink, sChapter) } - return emptyList() } override suspend fun search(query: String): List {