Add meta info for clients to store custom data in (#113)

* Add meta info for clients to store custom data in

* PR comments

* Really update migration
This commit is contained in:
Syer10
2021-05-29 19:48:08 -04:00
committed by GitHub
parent e69dbbf418
commit 6c22fe193a
14 changed files with 167 additions and 11 deletions

View File

@@ -11,6 +11,7 @@ import org.jetbrains.exposed.dao.id.IntIdTable
import org.jetbrains.exposed.sql.ResultRow
import org.jetbrains.exposed.sql.select
import org.jetbrains.exposed.sql.transactions.transaction
import suwayomi.tachidesk.impl.Chapter.getChapterMetaMap
import suwayomi.tachidesk.model.dataclass.ChapterDataClass
object ChapterTable : IntIdTable() {
@@ -51,4 +52,5 @@ fun ChapterTable.toDataClass(chapterEntry: ResultRow) =
chapterEntry[isDownloaded],
chapterEntry[pageCount],
transaction { ChapterTable.select { ChapterTable.manga eq chapterEntry[manga].value }.count().toInt() },
getChapterMetaMap(chapterEntry[id]),
)