package eu.friedcutlet.yokan.domain enum class ItemType(val label: String) { Manga("Manga"), Anime("Anime"), Novel("Novel"), } enum class Status(val label: String) { Ongoing("Ongoing"), Completed("Completed"), Canceled("Canceled"), Unknown("Unknown"), OnHiatus("On hiatus"), PublishingFinished("Publishing finished"), Licensed("Licensed"), Upcoming("Upcoming"), } enum class SourceCodeLanguage(val label: String) { JavaScript("JavaScript"), Mihon("Mihon"), LnReader("LNReader"), Aidoku("Aidoku"), } enum class TrackStatus(val label: String) { Reading("Reading"), Completed("Completed"), OnHold("On hold"), Dropped("Dropped"), PlanToRead("Plan to read"), ReReading("Re-reading"), Watching("Watching"), PlanToWatch("Plan to watch"), ReWatching("Re-watching"), } enum class ReaderMode(val label: String) { Paged("Paged"), ContinuousVertical("Continuous vertical"), Webtoon("Webtoon"), Novel("Novel"), } data class Repo( val name: String, val jsonUrl: String, val website: String? = null, ) data class Source( val id: Long, val name: String, val baseUrl: String, val lang: String, val itemType: ItemType, val typeSource: String, val iconUrl: String? = null, val isActive: Boolean = true, val isAdded: Boolean = false, val isPinned: Boolean = false, val isNsfw: Boolean = false, val hasCloudflare: Boolean = false, val supportLatest: Boolean = false, val version: String = "0.0.1", val versionLast: String = "0.0.1", val lastUsed: Boolean = false, val isObsolete: Boolean = false, val sourceCodeLanguage: SourceCodeLanguage = SourceCodeLanguage.JavaScript, val repo: Repo? = null, val notes: String = "", ) data class Category( val id: Long, val name: String, val forItemType: ItemType, val position: Int, val hidden: Boolean = false, val shouldUpdate: Boolean = true, ) data class Manga( val id: Long, val name: String, val alternativeTitles: List = emptyList(), val link: String, val imageUrl: String? = null, val customCoverImage: ByteArray? = null, val customCoverFromTracker: String? = null, val description: String, val author: String? = null, val artist: String? = null, val status: Status, val itemType: ItemType, val genres: List = emptyList(), val favorite: Boolean = false, val source: String, val lang: String, val dateAddedMillis: Long, val lastUpdateMillis: Long, val lastReadMillis: Long = 0L, val categories: List = emptyList(), val isLocalArchive: Boolean = false, val smartUpdateDays: Int? = null, val sourceId: Long? = null, val metadataServerId: String? = null, val metadataSource: String? = null, val metadataUpdatedAt: Long = 0L, val privateNote: String = "", val nextEpisodeAiringAt: Long = 0, val nextEpisodeNumber: Int? = null, val cast: List = emptyList(), /** Owning title when this record is one season of an Animetail Seasons-type title. */ val parentId: Long? = null, /** Animetail `FetchType.Seasons`: this title lists season records instead of episodes. */ val fetchesSeasons: Boolean = false, val seasonNumber: Double? = null, ) { override fun toString(): String = "Manga(id=$id)" override fun equals(other: Any?): Boolean { if (this === other) return true if (other == null || this::class != other::class) return false other as Manga if (id != other.id) return false if (favorite != other.favorite) return false if (dateAddedMillis != other.dateAddedMillis) return false if (lastUpdateMillis != other.lastUpdateMillis) return false if (lastReadMillis != other.lastReadMillis) return false if (isLocalArchive != other.isLocalArchive) return false if (smartUpdateDays != other.smartUpdateDays) return false if (sourceId != other.sourceId) return false if (metadataServerId != other.metadataServerId) return false if (metadataSource != other.metadataSource) return false if (metadataUpdatedAt != other.metadataUpdatedAt) return false if (name != other.name) return false if (alternativeTitles != other.alternativeTitles) return false if (link != other.link) return false if (imageUrl != other.imageUrl) return false if (!customCoverImage.contentEquals(other.customCoverImage)) return false if (customCoverFromTracker != other.customCoverFromTracker) return false if (privateNote != other.privateNote) return false if (nextEpisodeAiringAt != other.nextEpisodeAiringAt) return false if (nextEpisodeNumber != other.nextEpisodeNumber) return false if (description != other.description) return false if (author != other.author) return false if (artist != other.artist) return false if (status != other.status) return false if (itemType != other.itemType) return false if (genres != other.genres) return false if (source != other.source) return false if (lang != other.lang) return false if (categories != other.categories) return false if (cast != other.cast) return false if (parentId != other.parentId) return false if (fetchesSeasons != other.fetchesSeasons) return false if (seasonNumber != other.seasonNumber) return false return true } override fun hashCode(): Int { var result = id.hashCode() result = 31 * result + favorite.hashCode() result = 31 * result + dateAddedMillis.hashCode() result = 31 * result + lastUpdateMillis.hashCode() result = 31 * result + lastReadMillis.hashCode() result = 31 * result + isLocalArchive.hashCode() result = 31 * result + (smartUpdateDays ?: 0) result = 31 * result + (sourceId?.hashCode() ?: 0) result = 31 * result + (metadataServerId?.hashCode() ?: 0) result = 31 * result + (metadataSource?.hashCode() ?: 0) result = 31 * result + metadataUpdatedAt.hashCode() result = 31 * result + name.hashCode() result = 31 * result + alternativeTitles.hashCode() result = 31 * result + link.hashCode() result = 31 * result + (imageUrl?.hashCode() ?: 0) result = 31 * result + (customCoverImage?.contentHashCode() ?: 0) result = 31 * result + (customCoverFromTracker?.hashCode() ?: 0) result = 31 * result + privateNote.hashCode() result = 31 * result + nextEpisodeAiringAt.hashCode() result = 31 * result + (nextEpisodeNumber ?: 0) result = 31 * result + description.hashCode() result = 31 * result + (author?.hashCode() ?: 0) result = 31 * result + (artist?.hashCode() ?: 0) result = 31 * result + status.hashCode() result = 31 * result + itemType.hashCode() result = 31 * result + genres.hashCode() result = 31 * result + source.hashCode() result = 31 * result + lang.hashCode() result = 31 * result + categories.hashCode() result = 31 * result + cast.hashCode() result = 31 * result + (parentId?.hashCode() ?: 0) result = 31 * result + fetchesSeasons.hashCode() result = 31 * result + (seasonNumber?.hashCode() ?: 0) return result } } data class Chapter( val id: Long, val mangaId: Long, val name: String, val url: String, val dateUpload: String = "", val scanlator: String = "", val isBookmarked: Boolean = false, val isRead: Boolean = false, val lastPageRead: String = "", val archivePath: String = "", /** Effective filler state: the user's [fillerOverride] when set, otherwise the source value. */ val isFiller: Boolean = false, val thumbnailUrl: String? = null, val description: String? = null, val downloadSize: String? = null, val duration: String? = null, val fetchedAt: Long = 0, val number: Double? = null, val season: Int? = null, val numberingName: String? = null, val fillerOverride: Boolean? = null, ) data class History( val id: Long, val mangaId: Long, val chapterId: Long, val itemType: ItemType, val title: String, val chapterName: String, val date: String, val readingTimeSeconds: Int, val updatedAt: Long, /** Last reading position recorded for the chapter (page number or %). Empty when never opened. */ val lastPageRead: String = "", /** Whether the chapter is fully read; used by the History row to label "Finished" vs "Resume". */ val chapterIsRead: Boolean = false, ) data class Track( val id: Long, val libraryId: Long, val mediaId: Long, val mangaId: Long, val syncId: Int, val title: String, val progress: Int, val total: Int, val score: Int, val status: TrackStatus, val trackingUrl: String, val itemType: ItemType, ) data class UpdateEntry( val id: Long, val mangaId: Long, val chapterId: Long, val itemType: ItemType, val title: String, val chapterName: String, val source: String, val date: String, val isRead: Boolean, val updatedAt: Long, ) data class UserSettings( val displayType: DisplayType = DisplayType.ComfortableGrid, val followSystemTheme: Boolean = true, val darkTheme: Boolean = false, val incognitoMode: Boolean = false, val downloadedOnly: Boolean = false, val defaultReaderMode: ReaderMode = ReaderMode.Paged, val libraryShowCategoryTabs: Boolean = true, val libraryShowLanguage: Boolean = true, val libraryShowSource: Boolean = false, val libraryShowNumbersOfItems: Boolean = true, val showPagesNumber: Boolean = true, val concurrentDownloads: Int = 3, val allowConcurrentDownloads: Boolean = true, val downloadDelaySeconds: Int = 0, val checkForAppUpdates: Boolean = true, val checkForExtensionUpdates: Boolean = true, ) enum class DisplayType(val label: String) { CompactGrid("Compact grid"), ComfortableGrid("Comfortable grid"), CoverOnlyGrid("Cover-only grid"), List("List"), }