SAnime.kt
vendor/yokan-ext/src/androidMain/kotlin/eu/kanade/tachiyomi/animesource/model/SAnime.kt
1@file:Suppress("ktlint:standard:property-naming")23package eu.kanade.tachiyomi.animesource.model45import java.io.Serializable67interface SAnime : Serializable {8 var url: String910 var title: String1112 var artist: String?1314 var author: String?1516 var description: String?1718 var genre: String?1920 var status: Int2122 var thumbnail_url: String?2324 var update_strategy: AnimeUpdateStrategy2526 var initialized: Boolean2728 /** Older extension implementations need not provide optional credits. */29 var cast: List<Credit>?30 get() = null31 set(_) = Unit3233 /** Older extension implementations are episode lists. */34 var fetch_type: FetchType35 get() = FetchType.Episodes36 set(_) = Unit3738 /** -1 is unknown, as upstream. */39 var season_number: Double40 get() = -1.041 set(_) = Unit4243 fun copyFrom(other: SAnime) {44 title = other.title4546 if (other.author != null) {47 author = other.author48 }4950 if (other.artist != null) {51 artist = other.artist52 }5354 if (other.description != null) {55 description = other.description56 }5758 if (other.genre != null) {59 genre = other.genre60 }6162 if (other.thumbnail_url != null) {63 thumbnail_url = other.thumbnail_url64 }6566 status = other.status6768 // APKs may implement the older interface themselves rather than use SAnime.create().69 try {70 other.cast?.let { cast = it }71 } catch (_: AbstractMethodError) {72 // No credits accessor in that binary; its existing metadata remains usable.73 }7475 try {76 fetch_type = other.fetch_type77 season_number = other.season_number78 } catch (_: AbstractMethodError) {79 // Pre-season binary: it stays an episode list.80 }8182 if (!initialized) {83 initialized = other.initialized84 }85 }8687 companion object {88 const val UNKNOWN = 089 const val ONGOING = 190 const val COMPLETED = 291 const val LICENSED = 392 const val PUBLISHING_FINISHED = 493 const val CANCELLED = 594 const val ON_HIATUS = 695 const val UPCOMING = 79697 fun create(): SAnime = SAnimeImpl()98 }99}100