加载字数选项

优化数据保存类型,方便未来按字数过滤
根据选项自动决定是否加载正文
This commit is contained in:
Jason Yao committed 2023-05-07 18:09:46 -04:00
1 parent 248d677d28
commit 399ed44b5c
17 files changed
+166 -24

No files matched your search

@@ -61,6 +61,7 @@ object PreferKey {
const val changeSourceCheckAuthor = "changeSourceCheckAuthor"
const val changeSourceLoadToc = "changeSourceLoadToc"
const val changeSourceLoadInfo = "changeSourceLoadInfo"
const val changeSourceLoadWordCount = "changeSourceLoadWordCount"
const val chineseConverterType = "chineseConverterType"
const val launcherIcon = "launcherIcon"
const val textSelectAble = "selectText"
@@ -21,7 +21,7 @@ val appDb by lazy {
}
@Database(
version = 66,
version = 67,
exportSchema = true,
entities = [Book::class, BookGroup::class, BookSource::class, BookChapter::class,
ReplaceRule::class, SearchBook::class, SearchKeyword::class, Cookie::class,
@@ -51,7 +51,8 @@ val appDb by lazy {
AutoMigration(from = 62, to = 63),
AutoMigration(from = 63, to = 64),
AutoMigration(from = 64, to = 65, spec = DatabaseMigrations.Migration_64_65::class),
AutoMigration(from = 65, to = 66)
AutoMigration(from = 65, to = 66),
AutoMigration(from = 66, to = 67)
]
)
abstract class AppDatabase : RoomDatabase() {
@@ -15,7 +15,7 @@ interface SearchBookDao {
@Query(
"""select t1.name, t1.author, t1.origin, t1.originName, t1.coverUrl, t1.bookUrl,
t1.type, t1.time, t1.intro, t1.kind, t1.latestChapterTitle, t1.tocUrl, t1.variable,
t1.wordCount, t2.customOrder as originOrder
t1.wordCount, t2.customOrder as originOrder, t1.chapterWordCountText, t1.respondTime, t1.chapterWordCount
from searchBooks as t1 inner join book_sources as t2
on t1.origin = t2.bookSourceUrl
where t1.name = :name and t1.author like '%'||:author||'%'
@@ -27,7 +27,7 @@ interface SearchBookDao {
@Query(
"""select t1.name, t1.author, t1.origin, t1.originName, t1.coverUrl, t1.bookUrl,
t1.type, t1.time, t1.intro, t1.kind, t1.latestChapterTitle, t1.tocUrl, t1.variable,
t1.wordCount, t2.customOrder as originOrder
t1.wordCount, t2.customOrder as originOrder, t1.chapterWordCountText, t1.respondTime, t1.chapterWordCount
from searchBooks as t1 inner join book_sources as t2
on t1.origin = t2.bookSourceUrl
where t1.name = :name and t1.author like '%'||:author||'%'