♻️ 书源 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

+6 -6
View File
@@ -121,7 +121,7 @@ Client:removeFromShelfAsync("book_4", function(value, reason) result, err = valu
Assert.is_nil(result)
Assert.eq(err, "网易云阅读登录已失效")
Assert.is_false(Client.loggedIn())
require("source.auth").ok("ext.netease")
require("source.auth").ok("netease")
local fields = Mapper.readlog("book_4", toc, 3, 0.25, 1000)
Assert.eq(fields.articleUuid, "c2")
@@ -149,15 +149,15 @@ Assert.is_nil(result, "匿名接口也回 1,登录过期不能算同步成功"
Assert.not_nil(err)
Assert.eq(#requests, before + 1, "失效会话不发进度写请求")
Assert.is_false(Client.loggedIn())
Assert.is_true(require("source.auth").expired("ext.netease"))
require("source.auth").ok("ext.netease")
Assert.is_true(require("source.auth").expired("netease"))
require("source.auth").ok("netease")
response_meta = { code = 302, location = "https://yuedu.163.com/loginForm.do?targetUrl=myinfor.do" }
failure = "HTTP 302"
Client.putProgressAsync("book_4", toc, 3, 0, function(value, reason) result, err = value, reason end)
Assert.is_nil(result)
Assert.eq(err, "网易云阅读登录已失效")
Assert.is_false(Client.loggedIn(), "HTTP 层把 302 作为错误时仍要识别真正的登录重定向")
require("source.auth").ok("ext.netease")
require("source.auth").ok("netease")
response_meta = nil
failure = "network down"
Client.putProgressAsync("book_4", toc, 3, 0, function(value, reason) result, err = value, reason end)
@@ -200,14 +200,14 @@ request_api.get = get
local stored_toc
package.loaded["source.toc"] = {
put = function(id, stable_id, chapters)
Assert.eq(id, "ext.netease")
Assert.eq(id, "netease")
Assert.eq(stable_id, "book_4")
stored_toc = chapters
return true
end,
}
local source = require("moonsource_netease.source").new()
local identity = { source_id = "ext.netease", stable_id = "book_4" }
local identity = { source_id = "netease", stable_id = "book_4" }
response = JSON.encode(info)
source:getProgressAsync(identity, function(value, reason) result, err = value, reason end)
Assert.eq(result.chapter_idx, 3)