add realUrl to Manga, reperesents open in WebView URL

This commit is contained in:
Aria Moradi
2021-08-26 22:11:51 +04:30
parent 87f5e9b847
commit dfaecc08c5
6 changed files with 41 additions and 22 deletions

View File

@@ -26,9 +26,13 @@ data class MangaDataClass(
val status: String = MangaStatus.UNKNOWN.name,
val inLibrary: Boolean = false,
val source: SourceDataClass? = null,
/** meta data for clients */
val meta: Map<String, String> = emptyMap(),
val freshData: Boolean = false
val realUrl: String? = null,
val freshData: Boolean = false,
)
data class PagedMangaListDataClass(

View File

@@ -31,8 +31,11 @@ object MangaTable : IntIdTable() {
val inLibrary = bool("in_library").default(false)
val defaultCategory = bool("default_category").default(true)
// source is used by some ancestor of IntIdTable
// the [source] field name is used by some ancestor of IntIdTable
val sourceReference = long("source")
/** the real url of a manga used for the "open in WebView" feature */
val realUrl = varchar("real_url", 2048).nullable()
}
fun MangaTable.toDataClass(mangaEntry: ResultRow) =
@@ -52,7 +55,8 @@ fun MangaTable.toDataClass(mangaEntry: ResultRow) =
mangaEntry[genre],
Companion.valueOf(mangaEntry[status]).name,
mangaEntry[inLibrary],
meta = getMangaMetaMap(mangaEntry[id])
meta = getMangaMetaMap(mangaEntry[id].value),
realUrl = mangaEntry[realUrl],
)
enum class MangaStatus(val value: Int) {