Module:Album gallery

local p = {} local cargo = mw.ext.cargo

function p.buildWhereArtists(artists) local ret = 'albums.artist IN ('	local new_artists = ''	for r = 1, #artists do		new_artists = new_artists .. '"' .. artists[r] .. '"'		if r ~= #artists then			new_artists = new_artists .. " AND "		end	end	mw.logObject(ret .. new_artists .. ')')	return ret .. new_artists .. ')' end

function p._list(artists) local results = cargo.query( 'albums,releases', 'cover,albums._pageName=pageName,name', {		where = p.buildWhereArtists(artists) .. ' AND releases.release_date != "" AND (albums.type HOLDS "bootleg" OR albums.type HOLDS "compilation" OR albums.type HOLDS "demo" OR albums.type HOLDS "ep" OR albums.type HOLDS "live" OR albums.type HOLDS "promotional" OR albums.type HOLDS "soundtrack" OR albums.type HOLDS LIKE "%tudio" OR albums.type HOLDS "tribute" OR albums.type HOLDS "video")',		join = 'albums._pageName=releases._pageName',		orderBy = 'release_date ASC',		groupBy = 'albums.name'	} )

return results end

return p