diff --git a/README.md b/README.md index 6b713a2a..a1b1d673 100644 --- a/README.md +++ b/README.md @@ -14,8 +14,6 @@ Dantotsu is an [Anilist](https://anilist.co/) only client. > **Dantotsu (断トツ; Dan-totsu)** literally means "the best of the best" in Japanese. Try it out for yourself and be the judge! - - ## Terms of Use By downloading, installing, or using this application, you agree to: - Use the application in compliance with all applicable laws diff --git a/app/build.gradle b/app/build.gradle index bcda959a..b983443c 100644 --- a/app/build.gradle +++ b/app/build.gradle @@ -19,7 +19,7 @@ android { targetSdk 35 versionCode((System.currentTimeMillis() / 60000).toInteger()) versionName "3.2.1" - versionCode 300200100 + versionCode versionName.split("\\.").collect { it.toInteger() * 100 }.join("") as Integer signingConfig signingConfigs.debug } diff --git a/app/src/main/java/ani/dantotsu/parsers/AniyomiAdapter.kt b/app/src/main/java/ani/dantotsu/parsers/AniyomiAdapter.kt index adfd857e..fa1fa9a2 100644 --- a/app/src/main/java/ani/dantotsu/parsers/AniyomiAdapter.kt +++ b/app/src/main/java/ani/dantotsu/parsers/AniyomiAdapter.kt @@ -226,8 +226,18 @@ class DynamicAnimeParser(extension: AnimeExtension.Installed) : AnimeParser() { ?: return emptyList()) return try { - val videos = source.getVideoList(sEpisode) - videos.map { videoToVideoServer(it) } + // TODO(1.6): Remove else block when dropping support for ext lib <1.6 + if ((source as AnimeHttpSource).javaClass.declaredMethods.any { it.name == "getHosterList" }){ + val hosters = source.getHosterList(sEpisode) + val allVideos = hosters.flatMap { hoster -> + val videos = source.getVideoList(hoster) + videos.map { it.copy(videoTitle = "${hoster.hosterName} - ${it.videoTitle}") } + } + allVideos.map { videoToVideoServer(it) } + } else { + val videos = source.getVideoList(sEpisode) + videos.map { videoToVideoServer(it) } + } } catch (e: Exception) { Logger.log("Exception occurred: ${e.message}") emptyList() @@ -576,7 +586,7 @@ class VideoServerPassthrough(private val videoServer: VideoServer) : VideoExtrac number, format!!, FileUrl(videoUrl, headersMap), - if (aniVideo.totalContentLength == 0L) null else aniVideo.bytesDownloaded.toDouble() + null ) } diff --git a/app/src/main/java/eu/kanade/tachiyomi/animesource/AnimeSource.kt b/app/src/main/java/eu/kanade/tachiyomi/animesource/AnimeSource.kt index 171b07b2..4b54360a 100644 --- a/app/src/main/java/eu/kanade/tachiyomi/animesource/AnimeSource.kt +++ b/app/src/main/java/eu/kanade/tachiyomi/animesource/AnimeSource.kt @@ -1,5 +1,6 @@ package eu.kanade.tachiyomi.animesource +import eu.kanade.tachiyomi.animesource.model.Hoster import eu.kanade.tachiyomi.animesource.model.SAnime import eu.kanade.tachiyomi.animesource.model.SEpisode import eu.kanade.tachiyomi.animesource.model.Video @@ -48,6 +49,25 @@ interface AnimeSource { return fetchEpisodeList(anime).awaitSingle() } + /** + * Get the list of hoster for an episode. The first hoster in the list should + * be the preferred hoster. + * + * @since extensions-lib 16 + * @param episode the episode. + * @return the hosters for the episode. + */ + suspend fun getHosterList(episode: SEpisode): List = throw IllegalStateException("Not used") + + /** + * Get the list of videos for a hoster. + * + * @since extensions-lib 16 + * @param hoster the hoster. + * @return the videos for the hoster. + */ + suspend fun getVideoList(hoster: Hoster): List