♻️ 书源 id 去掉 ext. 前缀,沿用旧内置源数据

Co-authored-by: Copilot <[email protected]>
This commit is contained in:
GarfieldandCopilot committed 2026-11-16 14:07:45 +08:00
1 parent 01e572a5ee
commit f8ad3f73a6
29 files changed
+173 -173

No files matched your search

+14 -14
View File
@@ -27,7 +27,7 @@ do
cover = "http://x/c.jpg",
progressPercent = 42,
})
Assert.eq(b.source_id, "ext.weread")
Assert.eq(b.source_id, "weread")
Assert.eq(b.stable_id, "wx-1")
Assert.eq(b.title, "三体")
Assert.eq(b.percent, 42)
@@ -61,9 +61,9 @@ end
do
local b = Mapper.book({ bookId = "1", finished = 1, progress = 20, payType = 2, type = 0 })
Assert.eq(b.percent, 20)
Assert.eq(b.meta.source["ext.weread"].pay_type, 2)
Assert.eq(b.meta.source["ext.weread"].book_type, 0)
Assert.eq(b.meta.source["ext.weread"].ended, true)
Assert.eq(b.meta.source["weread"].pay_type, 2)
Assert.eq(b.meta.source["weread"].book_type, 0)
Assert.eq(b.meta.source["weread"].ended, true)
end
do
@@ -97,9 +97,9 @@ end
do
local Settings = require("utils.settings")
local cfg = Settings.getSource("ext.weread")
local cfg = Settings.getSource("weread")
cfg.category_as_group = true
Settings.saveSource("ext.weread", cfg)
Settings.saveSource("weread", cfg)
local list = Mapper.shelfList({
books = {
{ bookId = "1", title = "A", category = "官方" },
@@ -115,7 +115,7 @@ do
Assert.is_true(list.data[1].category_authoritative)
Assert.is_true(list.data[2].category_authoritative, "没进组也是这次快照的分类口径")
cfg.category_as_group = false
Settings.saveSource("ext.weread", cfg)
Settings.saveSource("weread", cfg)
local genre = Mapper.shelfList({
books = {
{ bookId = "1", title = "A", category = "官方" },
@@ -298,7 +298,7 @@ do
cover = "http://x/c.jpg",
progressPercent = 42,
})
Assert.eq(b.source_id, "ext.weread")
Assert.eq(b.source_id, "weread")
Assert.eq(b.stable_id, "wx-1")
Assert.eq(b.title, "三体")
Assert.eq(b.percent, 42)
@@ -332,9 +332,9 @@ end
do
local b = Mapper.book({ bookId = "1", finished = 1, progress = 20, payType = 2, type = 0 })
Assert.eq(b.percent, 20)
Assert.eq(b.meta.source["ext.weread"].pay_type, 2)
Assert.eq(b.meta.source["ext.weread"].book_type, 0)
Assert.eq(b.meta.source["ext.weread"].ended, true)
Assert.eq(b.meta.source["weread"].pay_type, 2)
Assert.eq(b.meta.source["weread"].book_type, 0)
Assert.eq(b.meta.source["weread"].ended, true)
end
do
@@ -368,9 +368,9 @@ end
do
local Settings = require("utils.settings")
local cfg = Settings.getSource("ext.weread")
local cfg = Settings.getSource("weread")
cfg.category_as_group = true
Settings.saveSource("ext.weread", cfg)
Settings.saveSource("weread", cfg)
local list = Mapper.shelfList({
books = {
{ bookId = "1", title = "A", category = "官方" },
@@ -386,7 +386,7 @@ do
Assert.is_true(list.data[1].category_authoritative)
Assert.is_true(list.data[2].category_authoritative, "没进组也是这次快照的分类口径")
cfg.category_as_group = false
Settings.saveSource("ext.weread", cfg)
Settings.saveSource("weread", cfg)
local genre = Mapper.shelfList({
books = {
{ bookId = "1", title = "A", category = "官方" },