Module:Songs: Difference between revisions

Jump to navigation Jump to search
15 bytes removed ,  Thursday at 01:55
m
no edit summary
mNo edit summary
mNo edit summary
Line 66: Line 66:
local groups = {}
local groups = {}
local songPages = {}
local songPages = {}
local songPageNames = {}
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.song_title] then groups[result.song_title] = {} end
if not groups[result.song_page] then groups[result.song_page] = {} end
songPageNames[result.song_title] = result.song_page
songNames[result.song_page] = result.song_title
table.insert(songPages, result.song_page)
table.insert(songPages, result.song_page)
table.insert(groups[result.song_title], { album = result.album, type = type })
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, songPageNames[song], song, head.album, head.type)
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 ..

Navigation menu