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

Contenuto cancellato Contenuto aggiunto
m correggo
Omega Bot (discussione | contributi)
m Bot: rimuovo no globals obsoleto
 
(14 versioni intermedie di un altro utente non mostrate)
Riga 4:
]]
 
require('Modulo:No globalsstrict')
 
local cfg = mw.loadData("Modulo:Fumetto e animazione/Configurazione/sandbox")
Riga 66:
-- Parsifica i parametri rimuovendo le stringhe vuote
local function parse_args(args)
local ret = {}
for key, value in pairs(args) do
value = mw.text.trim(value)
args[key] =if value ~= '' and value or nilthen
ret[key] = value
end
end
return argsret
end
 
Riga 128 ⟶ 131:
 
-- Cerca il nome o l'alias del medium nella configurazione
function Media:_getValue(key_tipotype_table_name, key_sottotiposubtype_table_name)
return cfg[key_sottotiposubtype_table_name][self.tipo] and
cfg[key_sottotiposubtype_table_name][self.tipo][self.sottotipo] or
cfg[key_tipotype_table_name][self.tipo]
end
 
Riga 147 ⟶ 150:
self.args = args
self.media = Media:new(args)
self.error_category = false
self.year = self:_getYear()
self.genre_table_name = self:_getGenreTableName()
self.error_category = false
self.categories = {}
self.tables_matched = {}
Riga 267 ⟶ 270:
-- Formatta e aggiunge una categoria
function CategoryManager:_addCategory(category)
if self.args.categoriescategorie ~= 'no' or category == error_category then
table.insert(self.categories, string.format('[[Categoria:%s]]', category))
end
Riga 364 ⟶ 367:
local start_date = self.args['data inizio'] or ''
local end_date = self.args['data fine'] or ''
local year = (start_date .. ' ' .. end_date):match('%f[%w]%d%d%d%d%f[%W]')
if year then
return year
else
self.errory_categoryerror_category = true
end
end