5,478
edits
mNo edit summary |
mNo edit summary |
||
Line 66: | Line 66: | ||
local groups = {} | local groups = {} | ||
local songTitles = {} | local songTitles = {} | ||
local songTitlesAdded = {} | |||
local songPageNames = {} | local songPageNames = {} | ||
for _, result in ipairs(results) do | for _, result in ipairs(results) do | ||
Line 86: | Line 87: | ||
if not groups[result.song_title] then groups[result.song_title] = {} end | if not groups[result.song_title] then groups[result.song_title] = {} end | ||
songPageNames[result.song_title] = result.song_page | songPageNames[result.song_title] = result.song_page | ||
table.insert(songTitles, result.song_title) | if not songTitlesAdded[result.song_title] then | ||
table.insert(songTitles, result.song_title) | |||
songTitlesAdded[result.song_title] = true | |||
end | |||
table.insert(groups[result.song_title], { album = result.album, type = type }) | table.insert(groups[result.song_title], { album = result.album, type = type }) | ||
end | end | ||
Line 97: | Line 101: | ||
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, songPageNames[song], song, head.album, head.type) | string.format('|-\n| rowspan=%d|[[%s|%s]] || [[%s]] || %s\n', rowspan, songPageNames[song], song, head.album, | ||
head.type) | |||
for _, row in ipairs(rows) do | for _, row in ipairs(rows) do | ||
text = text .. | text = text .. |