🐛 (notes): 想法按私密阅读设置发表并回读
新想法跟这本书的私密阅读走,修改已有想法沿用原来的可见范围。 回读对不上就当这轮失败,不把 HTTP 成功当成已经私密。
This commit is contained in:
1 parent
69a72f63c0
commit
352ee1bd99
11 files changed
+359
-57
No files matched your search
@@ -126,6 +126,19 @@ function Mapper.bookVersion(wire)
|
||||
return tonumber(book.version or book.bookVersion or wire.version or wire.bookVersion)
|
||||
end
|
||||
|
||||
--- 书籍详情 wire → 私密阅读。``secret==1`` 为 1,明确不是私密阅读为 0,认不出书就 nil。
|
||||
---@param wire table|nil
|
||||
---@return integer|nil
|
||||
function Mapper.bookSecret(wire)
|
||||
if type(wire) ~= "table" then return nil end
|
||||
local book = type(wire.book) == "table" and wire.book or wire
|
||||
if book.secret == nil and book.bookId == nil and book.version == nil and book.bookVersion == nil then
|
||||
return nil
|
||||
end
|
||||
if book.secret == 1 or book.secret == true then return 1 end
|
||||
return 0
|
||||
end
|
||||
|
||||
--- 微信专辑 → Book(及封面 URL)。
|
||||
---@param album table
|
||||
---@return Book|nil, string|nil
|
||||
|
||||
Reference in new issue
Block a user