Module:Availability

local p = {}

function p._main(song) local cargo = mw.ext.cargo local albums = cargo.query(		'track_listings, albums, releases',		"track_listings._pageName=title, releases.released=date, albums.type=type",		{			where = "releases.released != '' AND song = \"" .. song .. '"',			join = 'track_listings._pageName=albums._pageName,albums.name=releases.work',			groupBy = 'track_listings.work',			orderBy = 'releases.released ASC'		}	) local songs = cargo.query(		'track_listings, songs, releases',		"track_listings._pageName=title, releases.released=date, songs.type=type",		{			where = "releases.released != '' AND song = \"" .. song .. '"',			join = 'track_listings._pageName=songs._pageName,songs.name=releases.work',			groupBy = 'track_listings.work',			orderBy = 'releases.released ASC'		}	)

local releases = {}

for r = 1, #songs do		local result = songs[r] mw.logObject(result['date']) end end

function p.main(frame) local song = frame.args[1] return p._main(song) end

return p