Module:Songs: Difference between revisions

Jump to navigation Jump to search
410 bytes added ,  Wednesday at 18:01
no edit summary
No edit summary
No edit summary
Line 61: Line 61:
orderBy = "Album_Songs.song_title ASC"
orderBy = "Album_Songs.song_title ASC"
}
}
local fields = {'song_title', 'album'}
local fields = {'song_title', 'album', 'type'}
local results = cargo.query('Album_Songs', table.concat(fields, ','), query)
local results = cargo.query('Album_Songs', table.concat(fields, ','), query)
local table = '{| class="wikitable sortable mw-collapsible"\n! Song !! Album\n'
local table = '{| class="wikitable sortable mw-collapsible"\n! Song !! Album !! Type\n'
for _, row in ipairs(results) do
for _, row in ipairs(results) do
if row.song_title and row.song_title ~= "" and not string.find(row.song_title, "%(Game Size%)") and not string.find(row.song_title, "%(PV Size%)") then
if row.song_title and row.song_title ~= "" and not string.find(row.song_title, "%(Game Size%)") and not string.find(row.song_title, "%(PV Size%)") then
    table = table .. '|-\n| [[' .. row.song_title .. ']] || [[' .. row.album .. ']]\n'
            if not row.type or row.type == "solover" or row.type == "solo" then
if row.type == "solover" then
                    type = "'''" .. horseName .. " ver.'''"
                elseif row.type == "solo" then
                    type = "'''Solo'''"
                else
                    type = "Group"
                end           
                table = table .. '|-\n| [[' .. row.song_title .. ']] || [[' .. row.album .. ']] || ' .. type .. '\n'
            end
     end
     end
end
end
959

edits

Navigation menu