12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273 |
- package eu.kanade.tachiyomi.extension.model
- import android.graphics.drawable.Drawable
- import eu.kanade.tachiyomi.source.Source
- import tachiyomi.domain.source.model.StubSource
- sealed class Extension {
- abstract val name: String
- abstract val pkgName: String
- abstract val versionName: String
- abstract val versionCode: Long
- abstract val libVersion: Double
- abstract val lang: String?
- abstract val isNsfw: Boolean
- data class Installed(
- override val name: String,
- override val pkgName: String,
- override val versionName: String,
- override val versionCode: Long,
- override val libVersion: Double,
- override val lang: String,
- override val isNsfw: Boolean,
- val pkgFactory: String?,
- val sources: List<Source>,
- val icon: Drawable?,
- val hasUpdate: Boolean = false,
- val isObsolete: Boolean = false,
- val isUnofficial: Boolean = false,
- val isShared: Boolean,
- ) : Extension()
- data class Available(
- override val name: String,
- override val pkgName: String,
- override val versionName: String,
- override val versionCode: Long,
- override val libVersion: Double,
- override val lang: String,
- override val isNsfw: Boolean,
- val sources: List<Source>,
- val apkName: String,
- val iconUrl: String,
- ) : Extension() {
- data class Source(
- val id: Long,
- val lang: String,
- val name: String,
- val baseUrl: String,
- ) {
- fun toStubSource(): StubSource {
- return StubSource(
- id = this.id,
- lang = this.lang,
- name = this.name,
- )
- }
- }
- }
- data class Untrusted(
- override val name: String,
- override val pkgName: String,
- override val versionName: String,
- override val versionCode: Long,
- override val libVersion: Double,
- val signatureHash: String,
- override val lang: String? = null,
- override val isNsfw: Boolean = false,
- ) : Extension()
- }
|