5,478
edits
mNo edit summary |
mNo edit summary |
||
Line 66: | Line 66: | ||
local groups = {} | local groups = {} | ||
local songPages = {} | local songPages = {} | ||
local | local songNames = {} | ||
for _, result in ipairs(results) do | for _, result in ipairs(results) do | ||
local singers = mw.text.split(result.singers, ",") | local singers = mw.text.split(result.singers, ",") | ||
Line 84: | Line 84: | ||
if type ~= nil then | if type ~= nil then | ||
if not groups[result. | if not groups[result.song_page] then groups[result.song_page] = {} end | ||
songNames[result.song_page] = result.song_title | |||
table.insert(songPages, result.song_page) | table.insert(songPages, result.song_page) | ||
table.insert(groups[result. | table.insert(groups[result.song_page], { album = result.album, type = type }) | ||
end | end | ||
end | end | ||
Line 97: | Line 97: | ||
local head = table.remove(rows, 1) | local head = table.remove(rows, 1) | ||
text = text .. | text = text .. | ||
string.format('|-\n| rowspan=%d|[[%s|%s]] || [[%s]] || %s\n', rowspan, | string.format('|-\n| rowspan=%d|[[%s|%s]] || [[%s]] || %s\n', rowspan, song, songNames[song], head.album, head.type) | ||
for _, row in ipairs(rows) do | for _, row in ipairs(rows) do | ||
text = text .. | text = text .. |