Jump to content

Module:Video game wikidata

Permanently protected module
From Wikipedia, the free encyclopedia
This is an old revision of this page, as edited by Ferret (talk | contribs) at 16:48, 14 April 2016. The present address (URL) is a permanent link to this revision, which may differ significantly from the current revision.

local p = {}

-- Translation table for converting numeric-IDs to shorthand aliases.
local systemAliases = {
	[10677] = 'PS1',
	[1323662] = 'PS1', -- Placeholder, this is actually the series but could be mistakenly used for PS1.
	[10680] = 'PS2',
	[10683] = 'PS3',
	[5014725] = 'PS4',
	[16338] = 'PC',
	[8079] = 'Wii',
	[56942] = 'WiiU',
	[132020] = 'XBOX',
	[48263] = 'X360',
	[13361286] = 'XONE',
}

-- Translation table for converting system aliases to QIDs
local systemIDs = {
	['PS1'] = 10677,
	['PS2'] = 10680,
	['PS3'] = 10683,
	['PS4'] = 5014725,
	['PC'] = 16338,
	['WII'] = 8079,
	['WIIU'] = 56942,
	['XBOX'] = 132020,
	['X360'] = 48263,
	['XONE'] = 13361286,
}

-- List of accepted aggregator arguments and their related QID.
local aggregatorAliases = {
    [Q150248] = 'MC',
    [Q40160] = 'GR'
}   

-- List of accepted aggregator arguments and their related QID.
local aggregatorIDs = {
    ['MC'] = 'Q150248',
    ['GR'] = 'Q40160'
}   

-- List of accepted reviewer arguments and their related QID.
local reviewerAliases = {
}   

-- List of accepted reviewer arguments and their related QID.
local reviewerIDs = {
} 

function p.getSystemAlias(numericId)
	return systemAliases[numericId];
end

function p.getSystemID(system)
	return systemIDs[system];
end

function p.getAggregatorAlias(numericId)
	return aggregatorAliases[numericId];
end

function p.getAggregatorID(system)
	return aggregatorIDs[system];
end


function p.getReviewerAlias(numericId)
	return reviewerAliases[numericId];
end

function p.getReviewerID(system)
	return reviewerIDs[system];
end

return p