♻️ 书源 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 bea9eee670
commit 9e45e29d83
9 files changed
+21 -21

No files matched your search

+5 -5
View File
@@ -26,7 +26,7 @@ local function page(content, next_page)
end
local books, next_page, err = Mapper.shelfPage(page(row("first_4", "甲 & 乙"), 2), 1)
Assert.eq(books[1].source_id, "ext.netease")
Assert.eq(books[1].source_id, "netease")
Assert.eq(books[1].stable_id, "first_4")
Assert.eq(books[1].title, "甲 & 乙")
Assert.eq(books[1].authors, "作者甲")
@@ -87,7 +87,7 @@ package.loaded["book.books_db"] = {
pendingDeleteIds = function() return deleted end,
pendingShelfAddIds = function() return added end,
remove = function(id, stable_id)
Assert.eq(id, "ext.netease")
Assert.eq(id, "netease")
Assert.eq(stable_id, "deleted_4")
deleted = {}
return true
@@ -120,7 +120,7 @@ Assert.len(posts, 2, "拉完书架后推本地独有成员")
Assert.matches(posts[2].body, "id=added_4")
posts[2].cb(JSON.encode({ resultCode = 0 }))
pending[#pending].cb(page(row("first_4", "第一本") .. row("added_4", "新增")))
Assert.eq(reconciled.id, "ext.netease")
Assert.eq(reconciled.id, "netease")
Assert.is_true(reconciled.force)
Assert.eq(result.pulled, 2)
Assert.eq(result.pushed, 2)
@@ -162,14 +162,14 @@ Assert.len(added, 1)
package.loaded["ui/network/manager"] = { isConnected = function() return false end }
package.loaded["book.store"] = {
markDeleted = function(id, stable_id)
Assert.eq(id, "ext.netease")
Assert.eq(id, "netease")
Assert.eq(stable_id, "deleted_4")
deleted = { stable_id }
return true
end,
}
before = #posts
source:deleteBookAsync({ source_id = "ext.netease", stable_id = "deleted_4" }, done)
source:deleteBookAsync({ source_id = "netease", stable_id = "deleted_4" }, done)
require("support.stubs").flush()
Assert.is_true(result)
Assert.len(deleted, 1, "离线删除立即隐藏,墓碑等联网后再推")