add recentChapters endpoint

This commit is contained in:
Aria Moradi
2021-09-27 18:27:05 +03:30
parent 2e7a4f1421
commit d4d6d7e12f
14 changed files with 116 additions and 2 deletions

View File

@@ -25,6 +25,7 @@ object ChapterTable : IntIdTable() {
val isBookmarked = bool("bookmark").default(false)
val lastPageRead = integer("last_page_read").default(0)
val lastReadAt = long("last_read_at").default(0)
val fetchedAt = long("fetched_at").default(0)
val sourceOrder = integer("source_order")
@@ -48,6 +49,7 @@ fun ChapterTable.toDataClass(chapterEntry: ResultRow) =
chapterEntry[lastPageRead],
chapterEntry[lastReadAt],
chapterEntry[sourceOrder],
chapterEntry[fetchedAt],
chapterEntry[isDownloaded],
chapterEntry[pageCount],
transaction { ChapterTable.select { manga eq chapterEntry[manga].value }.count().toInt() },

View File

@@ -31,6 +31,7 @@ object MangaTable : IntIdTable() {
val inLibrary = bool("in_library").default(false)
val defaultCategory = bool("default_category").default(true)
val inLibraryAt = long("in_library_at").default(0)
// the [source] field name is used by some ancestor of IntIdTable
val sourceReference = long("source")
@@ -56,6 +57,7 @@ fun MangaTable.toDataClass(mangaEntry: ResultRow) =
mangaEntry[genre].toGenreList(),
Companion.valueOf(mangaEntry[status]).name,
mangaEntry[inLibrary],
mangaEntry[inLibraryAt],
meta = getMangaMetaMap(mangaEntry[id].value),
realUrl = mangaEntry[realUrl],
)