66 773
contributi
Nessun oggetto della modifica |
Nessun oggetto della modifica |
||
Riga 88: | Riga 88: | ||
local CategoryText | local CategoryText | ||
local Pages | local Pages | ||
local SeriesShort | |||
if not Item then | if not Item then | ||
Riga 96: | Riga 97: | ||
end | end | ||
SeriesShort = mw.wikibase.getEntity(Item.claims['P16'][1].mainsnak.datavalue.value.id).claims['P24'][1].mainsnak.datavalue.value | |||
if ShortName == "Serie Classica" or ShortName == "Serie Animata" then | if ShortName == "Serie Classica" or ShortName == "Serie Animata" then | ||
CategoryText = '[[Category:Personaggi della ' .. | CategoryText = '[[Category:Personaggi della ' .. SeriesShort .. "]]" | ||
else | else | ||
CategoryText = '[[Category:Personaggi di ' .. | CategoryText = '[[Category:Personaggi di ' .. SeriesShort .. "]]" | ||
end | end | ||
Riga 114: | Riga 115: | ||
if type(Pages) == "table" then | if type(Pages) == "table" then | ||
for _, Page in ipairs(Pages.results) do | for _, Page in ipairs(Pages.results) do | ||
local Count | |||
-- Page.fulltext represents Page name | -- Page.fulltext represents Page name | ||
table.insert(Results, "* " .. Page.fulltext) | Count = mw.smw.ask('[[Serie::' .. SeriesShort .. ']][[Personaggio::' .. Page.fulltext .. ']]|format=count')[1]["Personaggio"] | ||
table.insert(Results, "* " .. Page.fulltext .. " - " .. count) | |||
end | end | ||
else | else |