1,091
个编辑
小 (haskell) |
小 (版本) |
||
第10行: | 第10行: | ||
end | end | ||
for i = 1, 4 do info.ratings[i] = opt("%s", info.ratings[i], "/") end | for i = 1, 4 do info.ratings[i] = opt("%s", info.ratings[i], "/") end | ||
return ("|-\n|%s||[[文件:Songs %s.jpg|75px]]||%s||%s||%s||%s||%s||%s"):format( | return ("|-\n|%s||[[文件:Songs %s.jpg|75px]]||%s||%s||%s||%s||%s||%s||%s"):format( | ||
table.concat(info.plat), info.id, | table.concat(info.plat), info.id, | ||
"[[" .. info.title .. "]]" .. opt('<br /><span lang="ja">-{%s}-</span>', info.title2), | "[[" .. info.title .. "]]" .. opt('<br /><span lang="ja">-{%s}-</span>', info.title2), | ||
info.artist, info.pack, | info.artist, info.pack, | ||
opt("data-sort-value=%s|", info.bpm_base) .. info.bpm, | opt("data-sort-value=%s|", info.bpm_base) .. info.bpm, | ||
info.duration, table.concat(info.ratings, "||") | info.duration, info.version, table.concat(info.ratings, "||") | ||
) | ) | ||
end | end | ||
第23行: | 第23行: | ||
local plst = mw.loadData "Module:packlist index" | local plst = mw.loadData "Module:packlist index" | ||
local durs = mw.text.jsonDecode(mw.title.new "Template:duration.json":getContent()) | local durs = mw.text.jsonDecode(mw.title.new "Template:duration.json":getContent()) | ||
local vers = mw.text.jsonDecode(mw.title.new "Template:version map.json":getContent()) | |||
return table.concat(stream.Array(mw.loadData "Module:songlist index".slst) | return table.concat(stream.Array(mw.loadData "Module:songlist index".slst) | ||
:filter(function(v) return v.id ~= "lasteternity" end) | :filter(function(v) return v.id ~= "lasteternity" end) | ||
:map(function(song) return { | :map(function(song) return { | ||
plat = { "[[文件:Icon Smartphone.png|16px|link= | plat = { "[[文件:Icon Smartphone.png|16px|link=Arcaea (移动版)]]" }, id = song.id, | ||
-- Arcaea (Nintendo Switch版) | |||
title = slstIdx[song.id].title, title2 = song.title_localized.ja or song.title_localized["zh-Hans"], | title = slstIdx[song.id].title, title2 = song.title_localized.ja or song.title_localized["zh-Hans"], | ||
artist = '<span lang="ja">-{' .. song.artist .. "}-</span>", pack = plst[song.set], | artist = '<span lang="ja">-{' .. song.artist .. "}-</span>", pack = plst[song.set], | ||
bpm = song.bpm, bpm_base = tonumber(song.bpm) ~= song.bpm_base and song.bpm_base or nil, | bpm = song.bpm, bpm_base = tonumber(song.bpm) ~= song.bpm_base and song.bpm_base or nil, | ||
duration = durs[song.id] or 0, | duration = durs[song.id] or 0, | ||
version = song.version .. "." .. (vers[song.id] or | |||
vers[mw.language.getContentLanguage():formatDate("Y/n/j", "@" .. song.date)] or | |||
-- mw.getCurrentFrame():expandTemplate { title = "Template:version", args = { "mobile" } }:match "[^.]+$"), | |||
"[[Template:version map.json|E]]"), | |||
ratings = stream.Array(song.difficulties):map(function(v) return v.rating .. opt("+", v.ratingPlus) end):toArray(), | ratings = stream.Array(song.difficulties):map(function(v) return v.rating .. opt("+", v.ratingPlus) end):toArray(), | ||
date = song.date | date = song.date |
个编辑