Module:曲师列表:修订间差异
接入 模块:数据页校验:数据页结构错误时显红字并归入 分类:数据页异常(不再静默渲染空表) |
改用 模块:署名解析 统一拆词;标题下显示实时曲目数(替代映射表中无法维护的 _曲目数) |
||
| 第12行: | 第12行: | ||
local DIFFS = { 'CASUAL', 'TOUGH', 'INSANE', 'PRO' } | local DIFFS = { 'CASUAL', 'TOUGH', 'INSANE', 'PRO' } | ||
-- | -- 拆词与归一化统一由 模块:署名解析 提供(本模块不再自带一份,避免规则漂移) | ||
local | local parse = require('模块:署名解析') | ||
local norm = parse.norm | |||
-- ===== 工具 ===== | -- ===== 工具 ===== | ||
| 第34行: | 第31行: | ||
end | end | ||
-- 排序分组: 0=符号/数字 1=拉丁 2=假名 3=汉字 4=其他 | -- 排序分组: 0=符号/数字 1=拉丁 2=假名 3=汉字 4=其他 | ||
| 第130行: | 第104行: | ||
local raw = song['曲师'] | local raw = song['曲师'] | ||
if type(raw) == 'table' then raw = raw[1] end | if type(raw) == 'table' then raw = raw[1] end | ||
local parts = | local parts = parse.parts(raw) | ||
local seen = {} | local seen = {} | ||
for _, pt in ipairs(parts) do | for _, pt in ipairs(parts) do | ||
| 第168行: | 第142行: | ||
local a = artists[key] | local a = artists[key] | ||
table.insert(out, '\n==' .. esc(a.display) .. '==') | table.insert(out, '\n==' .. esc(a.display) .. '==') | ||
-- 曲目数实时统计(替代此前映射表里无法维护的 _曲目数) | |||
table.insert(out, '<div style="font-size:92%;color:#555">共 ' .. "'''" .. #a.songs .. "'''" .. ' 首曲目</div>') | |||
if a.intro ~= '' then | if a.intro ~= '' then | ||
table.insert(out, a.intro) | table.insert(out, a.intro) | ||
| 第178行: | 第154行: | ||
local notes = {} | local notes = {} | ||
local rawS = type(s['曲师']) == 'table' and s['曲师'][1] or s['曲师'] | local rawS = type(s['曲师']) == 'table' and s['曲师'][1] or s['曲师'] | ||
local allParts = | local allParts = parse.parts(rawS) | ||
for _, pt in ipairs(allParts) do | for _, pt in ipairs(allParts) do | ||
if norm(pt.base) ~= key then table.insert(notes, pt.base) end | if norm(pt.base) ~= key then table.insert(notes, pt.base) end | ||