Module:曲师列表:修订间差异
新增「未确认名义」段(中文键改为字符串键,修正语法);曲师列表计入 special |
备注并入「参与」(读 模板:曲师参与.json);合作备注改用映射表成员,不再拆词 |
||
| 第150行: | 第150行: | ||
end | end | ||
local map = loadJson(MAP_TITLE) or {} | local map = loadJson(MAP_TITLE) or {} | ||
local roles = loadJson('模板:曲师参与.json') or {} -- 参与(作曲/作词/人声…):人工知识,并入备注 | |||
local lk = buildLookup(map) | local lk = buildLookup(map) | ||
local intros = loadIntros() | local intros = loadIntros() | ||
| 第171行: | 第172行: | ||
or intros[key] or intros[norm(m['显示名'] or pt.base)] or '', | or intros[key] or intros[norm(m['显示名'] or pt.base)] or '', | ||
sort = m['排序键'] or '', | sort = m['排序键'] or '', | ||
unconfirmed = m['_未确认'] or false, | unconfirmed = m['_未确认'] or false, | ||
songs = {}, | songs = {}, | ||
| 第177行: | 第177行: | ||
table.insert(order, key) | table.insert(order, key) | ||
end | end | ||
table.insert(artists[key].songs, { song = song, ann = pt.ann, base = pt.base }) | table.insert(artists[key].songs, { song = song, ann = pt.ann, base = pt.base, raw = raw, other = pt.other }) | ||
end | end | ||
end | end | ||
| 第210行: | 第210行: | ||
for _, item in ipairs(a.songs) do | for _, item in ipairs(a.songs) do | ||
local s = item.song | local s = item.song | ||
-- 备注: | -- 备注: 参与(来自 模板:曲师参与.json) ;与…合作 ;名义:X | ||
local rawS = type(s['曲师']) == 'table' and s['曲师'][1] or s['曲师'] | |||
local notes = {} | local notes = {} | ||
local rawS | local r = roles[parse.norm(rawS)] | ||
if r and type(r[s['曲名']]) == 'table' then | |||
local rl = {} | |||
if | for _, x in ipairs(r[s['曲名']]) do rl[#rl + 1] = x end | ||
if #rl > 0 then table.insert(notes, table.concat(rl, '、')) end | |||
end | end | ||
local | local others = {} | ||
if | if item.other then | ||
for _, q in ipairs(item.other) do | |||
if parse.norm(q) ~= key then table.insert(others, q) end | |||
end | |||
else | |||
for _, pt in ipairs(parse.parts(rawS)) do | |||
if norm(pt.base) ~= key then table.insert(others, pt.base) end | |||
end | |||
end | end | ||
if #others > 0 then table.insert(notes, '与 ' .. table.concat(others, '、') .. ' 合作') end | |||
if item.ann ~= '' and item.ann ~= nil then table.insert(notes, item.ann) end | |||
local note = table.concat(notes, ';') | |||
table.insert(out, '|-') | table.insert(out, '|-') | ||
table.insert(out, '| [[' .. '曲目:' .. esc(pageName(s)) .. '|' .. langWrap(s) .. ']] || ' | table.insert(out, '| [[' .. '曲目:' .. esc(pageName(s)) .. '|' .. langWrap(s) .. ']] || ' | ||