Yokan / rebuild
Course 1 8624561

AnimeSource.kt

vendor/yokan-ext/src/androidMain/kotlin/eu/kanade/tachiyomi/animesource/AnimeSource.kt

implementation87 lines
1package eu.kanade.tachiyomi.animesource23import eu.kanade.tachiyomi.animesource.model.SAnime4import eu.kanade.tachiyomi.animesource.model.AnimeRelation5import eu.kanade.tachiyomi.animesource.model.SEpisode6import eu.kanade.tachiyomi.animesource.model.Video7import eu.kanade.tachiyomi.util.lang.awaitSingle8import rx.Observable910/**11 * A basic interface for creating a source. It could be an online source, a local source, etc.12 */13interface AnimeSource {14    /**15     * ID for the source. Must be unique.16     */17    val id: Long1819    /**20     * Name of the source.21     */22    val name: String2324    val lang: String25        get() = ""2627    val supportsRelatedAnime: Boolean28        get() = false2930    suspend fun getRelatedAnimeList(anime: SAnime): List<AnimeRelation> = emptyList()3132    /**33     * Seasons of a [eu.kanade.tachiyomi.animesource.model.FetchType.Seasons] anime; each is its own anime.34     *35     * @since extensions-lib 1636     */37    suspend fun getSeasonList(anime: SAnime): List<SAnime> = emptyList()3839    /**40     * Get the updated details for a anime.41     *42     * @since extensions-lib 1.543     * @param anime the anime to update.44     * @return the updated anime.45     */46    @Suppress("DEPRECATION")47    suspend fun getAnimeDetails(anime: SAnime): SAnime = fetchAnimeDetails(anime).awaitSingle()4849    /**50     * Get all the available episodes for a anime.51     *52     * @since extensions-lib 1.553     * @param anime the anime to update.54     * @return the episodes for the anime.55     */56    @Suppress("DEPRECATION")57    suspend fun getEpisodeList(anime: SAnime): List<SEpisode> = fetchEpisodeList(anime).awaitSingle()5859    /**60     * Get the list of videos a episode has. Pages should be returned61     * in the expected order; the index is ignored.62     *63     * @since extensions-lib 1.564     * @param episode the episode.65     * @return the videos for the episode.66     */67    @Suppress("DEPRECATION")68    suspend fun getVideoList(episode: SEpisode): List<Video> = fetchVideoList(episode).awaitSingle()6970    @Deprecated(71        "Use the non-RxJava API instead",72        ReplaceWith("getAnimeDetails"),73    )74    fun fetchAnimeDetails(anime: SAnime): Observable<SAnime> = throw IllegalStateException("Not used")7576    @Deprecated(77        "Use the non-RxJava API instead",78        ReplaceWith("getEpisodeList"),79    )80    fun fetchEpisodeList(anime: SAnime): Observable<List<SEpisode>> = throw IllegalStateException("Not used")8182    @Deprecated(83        "Use the non-RxJava API instead",84        ReplaceWith("getVideoList"),85    )86    fun fetchVideoList(episode: SEpisode): Observable<List<Video>> = throw IllegalStateException("Not used")87}88

Search chapters, reference and source filenames.