Module:Infobox album

local p = {}

local types = { ['ep'] = { color = 'lightsalmon', link = 'EP', category = 'EPs', respect_casing = true },	['studio'] = { color = 'lightsteelblue', link = 'Studio album', category = 'Studio albums' },	['demo'] = { color = 'khaki', link = 'Demo album', category = 'Demo albums' },	['live'] = { color = 'burlywood', link = 'Live album', category = 'Live albums' },	['greatest hits'] = { color = 'darkseagreen', link = 'Compilation album', category = 'Compilation albums' },	['box set'] = { color = 'darkseagreen', link = 'Box set', category = 'Box sets' },	['compilation'] = { color = 'darkseagreen', link = 'Compilation album', category = 'Compilation albums' },	['remix'] = { color = 'peachpuff', link = 'Remix album', category = 'Category:Remix albums' },	['soundtrack'] = { color = 'gainsboro', link = 'Soundtrack', category = 'Soundtrack albums' },	['film score'] = { color = 'gainsboro', link = 'Soundtrack album', category = 'Soundtrack albums' },	['video'] = { color = '&#32;#99CCFF', link = 'Video release', category = 'Video releases' },	['promotional'] = { color = 'peachpuff', link = 'Promotional release', category = 'Promotional releases' },	['tribute'] = { color = 'peachpuff', link = 'Tribute album', category = 'Tribute albums' },	['bootleg'] = { color = '&#32;#E6E8FA', link = 'Bootleg', category = 'Bootleg albums' } }

local artists = { ['The Smashing Pumpkins'] = true, ['Billy Corgan'] = true, ['Zwan'] = true, ['James Iha'] = true, ['Jimmy Chamberlin Complex'] = true, ['The Marked'] = true, ['Various artists'] = true }

function p.link( frame ) local given = mw.text.split(frame.args[1], "%s*,%s*") return types[given[1]].link end

function p.color( frame ) local given = mw.text.split(frame.args[1], "%s*,%s*") return types[given[1]].color end

function p.categories( frame ) local given = mw.text.split(frame.args[1], "%s*,%s*") local artist = frame.args[2] local is_tribute = string.find(frame.args[1], "tribute")

if artists[artist] == nil and not(is_tribute) then return '' end

local cats = ''

if not(is_tribute) then cats = cats .. ''	end

if artist == 'The Marked' then return cats end

for _, v in ipairs(given) do		local data = types[v] cats = cats .. ''

if artist ~= 'Various artists' and not(is_tribute) then if data.respect_casing then cats = cats .. ''			else cats = cats .. ''			end end end return cats end

function p._studio_sessions(album) local cargo = mw.ext.cargo local results = cargo.query(		'studio_sessions, albums',		'studio_sessions._pageName=page',		{			where = 'albums.name = "' .. album .. '"',			join = 'studio_sessions.album HOLDS albums.name',			orderBy = 'date_from ASC',			groupBy = 'studio_sessions._pageName'		}	)

if 0 == #results then return '' elseif 1 == #results then return  .. results[1]['page'] ..  end

local root = mw.html.create local ulRoot = root:tag('ul') :addClass('studio-sessions') local sessions = {} for r = 1, #results do		local page = results[r]['page'] if page ~= nil and page ~= '' then ulRoot:tag('li') :wikitext( .. page .. ) end end

return tostring(root) end

function p.studio_sessions(frame) local album = frame.args[1] return p._studio_sessions(album) end

return p