package eu.kanade.tachiyomi.animesource import eu.kanade.tachiyomi.animesource.model.SAnime import eu.kanade.tachiyomi.animesource.model.AnimeRelation import eu.kanade.tachiyomi.animesource.model.SEpisode import eu.kanade.tachiyomi.animesource.model.Video import eu.kanade.tachiyomi.util.lang.awaitSingle import rx.Observable /** * A basic interface for creating a source. It could be an online source, a local source, etc. */ interface AnimeSource { /** * ID for the source. Must be unique. */ val id: Long /** * Name of the source. */ val name: String val lang: String get() = "" val supportsRelatedAnime: Boolean get() = false suspend fun getRelatedAnimeList(anime: SAnime): List = emptyList() /** * Seasons of a [eu.kanade.tachiyomi.animesource.model.FetchType.Seasons] anime; each is its own anime. * * @since extensions-lib 16 */ suspend fun getSeasonList(anime: SAnime): List = emptyList() /** * Get the updated details for a anime. * * @since extensions-lib 1.5 * @param anime the anime to update. * @return the updated anime. */ @Suppress("DEPRECATION") suspend fun getAnimeDetails(anime: SAnime): SAnime = fetchAnimeDetails(anime).awaitSingle() /** * Get all the available episodes for a anime. * * @since extensions-lib 1.5 * @param anime the anime to update. * @return the episodes for the anime. */ @Suppress("DEPRECATION") suspend fun getEpisodeList(anime: SAnime): List = fetchEpisodeList(anime).awaitSingle() /** * Get the list of videos a episode has. Pages should be returned * in the expected order; the index is ignored. * * @since extensions-lib 1.5 * @param episode the episode. * @return the videos for the episode. */ @Suppress("DEPRECATION") suspend fun getVideoList(episode: SEpisode): List