Refactor duplication in #15088 (#15094)

This commit is contained in:
David authored and GitHub committed 2026-03-08 17:39:11 +01:00
1 parent 54de4f188c
commit fdd810d5a1
1 file changed
+1 -3
+1 -3
View File
@@ -40,9 +40,7 @@ local search_used_metadata = {
local function slim(book, is_search)
local slim_book = rapidjson.object({})
for _, k in ipairs(is_search and search_used_metadata or used_metadata) do
if k == "series" or k == "series_index" then
slim_book[k] = book[k] or rapidjson.null
elseif k == "tags" or k == "authors" then
if k == "tags" or k == "authors" then
slim_book[k] = book[k] or rapidjson.array({})
else
slim_book[k] = book[k] or rapidjson.null