Module:Video game wikidata: Difference between revisions

Content deleted Content added
Add Nintendo Switch
Implementing MOS RFC.
 
(8 intermediate revisions by 4 users not shown)
Line 45:
[184839] = 'N64',
[182172] = 'GC', -- Sometimes has been NGC
[19610114] = 'NS', -- Nintendo Switch
[98973368] = 'XSX/S', -- Xbox Series X and Series S (Output label differs from the input parameter, XSXS, per RFC)
[63184502] = 'PS5'
}
 
Line 77 ⟶ 79:
['GC'] = 182172,
['NGC'] = 182172,
['NS'] = 19610114,
['XSXS'] = 98973368, -- This is the template parameter, which cannot contain a / or | character.
['PS5'] = 63184502
}
 
Line 107 ⟶ 111:
 
local function sortByPlatform(a,b)
local platformA = nil"";
local platformB = nil"";
if(a['qualifiers']['P400'] ~= nil and ba['qualifiers']['P400'][1] ~= nil) then
platformA = p.getSystemAlias(a['qualifiers']['P400'][1]['datavalue']['value']['numeric-id']);
if(platformA == nil) then
Line 265 ⟶ 269:
 
if(reviewscore['references'] ~= nil and reviewscore['references'][1] ~= nil and genRefs) then
local cite = buildCite(reviewscore['references'][1], df);
if(cite ~= nil) then
Line 352 ⟶ 356:
-- Check for a game parameter. If missing, default to current article.
if(iGame ~= nil and iGame ~= "") then
if(entities[iGame] == nil and mw.wikibase ~= nil) then
entities[iGame] = mw.wikibase.getEntity(iGame);
end;
Line 359 ⟶ 363:
else
-- Need to research if we can determine the entity's ID before retrieving it.
entity = if(mw.wikibase.getEntity( ~= nil); then
if( entity ~= nilmw.wikibase.getEntity() then;
entities[if(entity['id']] ~= entity;nil) then
entities[entity['id']] = entity;
end;
end;
end;
Line 413 ⟶ 419:
elseif(updateLinkStyle == "noSub") then
return '[[d:'..entity['id']..'#P444|[±]]]';
elseif(updateLinkStyle == "text and pen") then
return '<span style="position: relative;"><span style="position: absolute; right: 0;">[[File:Blue pencil.svg|10px|baseline|link=|alt=]]</span>[[d:'..entity['id']..'#P444|<span style="position: relative; padding-right: 14px;">Edit on Wikidata</span>]]</span>'
end;
Line 446 ⟶ 454:
if(pubDates) then
for i,pubDate in pairs(pubDates) do
if(pubDate['mainsnak']['datavalue']) then
local timestamp = pubDate['mainsnak']['datavalue']['value']['time'];
local accessdate = Date(timestamp);
table.insert(ret,accessdate);
end;
end;
end;