Modulo:Fumetto e animazione/sandbox: differenze tra le versioni

Contenuto cancellato Contenuto aggiunto
correggo
correggo
Riga 23:
-- Restituisce un valore senza eventuale wikilink a inizio stringa
local function delink(value)
if not value then return end
local pattern
if value:find('|') then
Riga 84 ⟶ 85:
setmetatable(self, { __index = Media })
 
self.tipoargs = args.tipo
self.sottotipotipo = args.sottotipoself:_getType()
self.sottotipo = self:_getSubtype()
self.name = self:_getName()
self.alias = self:_getAlias()
Riga 110 ⟶ 112:
function Media:_getName()
return self:_getValue('tipo', 'sottotipo')
end
 
-- Verifica che il sottotipo di medium sia riconosciuto
function Media:_getSubtype()
if cfg.sottotipo[self.tipo] and cfg.sottotipo[self.tipo][self.args.sottotipo] then
return self.args.sottotipo
end
end
 
-- Verifica che il tipo di medium sia riconosciuto
function Media:_getType()
if cfg.tipo[self.args.tipo] or cfg.sottotipo[self.args.tipo] then
return self.args.tipo
end
end
 
Riga 153 ⟶ 169:
end
 
if error_only or self.media.name == nil then return end
 
if self.media.name == "serie televisive d'animazione" then
Riga 171 ⟶ 187:
:_addCategoriesBy('editore_manga')
:_addCategoriesBy('editore')
:_addCategoriesBy('target', nil, self.ucfirst_ucfirst)
elseif self.media:inArray('manhua', 'manhwa') then
self:_addCategoriesBy('editore')
Riga 180 ⟶ 196:
:_addCategoriesBy('etichetta')
:_addCategoriesBy('editore')
elseif self.media.tipo == 'fumetto' and self.media.name ~= 'fumetti'sottotipo then
self
:_addCategoriesBy('etichetta_sottotipo', nil, self._prependSubtype)
Riga 204 ⟶ 220:
local network = self.args['rete 1'] or self.args.rete
broadcaster = self:_getCategory(delink(network), 'rete')
end
elseif self.media.alias == 'webserie' then
if not broadcaster and self.media:inArray('film TV', 'ONA', 'serie TV', 'webserie') then
local platform = self.args['streaming 1'] or self.args.streaming
broadcaster = self:_getCategory(delink(platform), 'streaming')
Riga 218 ⟶ 235:
-- categorizzazione delle opere suddivise per anno
elseif self.year and self.media.sottotipo ~= 'film direct-to-video' then
local media = self.media.namesottotipo ~= 'serie televisive animeTV' and
self.media.alias or self.media.name
self:_addCategory(string.format('%s del %s', media, self.year))
Riga 330 ⟶ 347:
-- Antepone il sottotipo dell'opera a una stringa
function CategoryManager:_prependSubtype(value)
return self.media.sottotipo .. ' ' .. value
end
 
-- Converte la lettera iniziale di una stringa in maiuscola
function CategoryManager:ucfirst_ucfirst(str)
return str:gsub('^%l', string.upper)
end