Modulo:StagioniTV/sandbox: differenze tra le versioni

Contenuto cancellato Contenuto aggiunto
mNessun oggetto della modifica
m ----
Riga 22:
function p._prova(args)
local template, sfondo, categoria, target, stagioneoedizione, title, preposizione, links, errore
local id, localID, tipo, titolo, etichetta, nome, sitelink, stagioni
local pageTitle = args[1] or args.titolo
 
Riga 62:
if tipo == 'programma' then
if string.find(mw.title.getCurrentTitle().text, '%(programma.+edizione%)$') then nome = sitelink
title = mw.title.new(string.format('Categoria:Edizioni de %s', etichetta))
else nome = etichetta
end
elseif tipo == 'serie TV' or tipo == 'animata' then
if string.find(mw.title.getCurrentTitle().text, '^Episodi d[ei] .+ %(.*serie') then nome = sitelink
elseif mw.title.new(string.format('Episodi di %s (prima stagione)', sitelink)).exists or mw.title.new(string.format('Episodi di %s (prima stagione)', sitelink)).exists then
nome = sitelink
else nome = etichetta
end
end
if tipo == 'programma' then
title = mw.title.new(string.format('Categoria:Edizioni de %s', etichettanome))
preposizione = (title and title.exists) and 'de' or 'di'
elseif tipo == 'serie TV' or tipo == 'animata' then
if string.find(mw.title.getCurrentTitle().text, '^Episodi d[ei]') then
preposizione = string.find(mw.title.getCurrentTitle().text, '^Episodi de') and 'de' or 'di'
else title = mw.title.new(string.format('Episodi de %s (prima stagione)', etichettanome))
preposizione = (title and title.exists) and 'de' or 'di'
end
Riga 75 ⟶ 87:
if tipo == 'programma' then
target = string.format('%s (%s edizione)', etichettanome, ordinaleF) else
target = string.format('Episodi %s %s (%s stagione)', preposizione, etichettanome, ordinaleF)
end
if tipo == 'programma' then stagioneoedizione = 'edizione' else stagioneoedizione = 'stagione' end
Riga 86 ⟶ 98:
if (target == mw.title.getCurrentTitle().text and mw.title.getCurrentTitle().namespace == 0) or args.debug then
if stagioni == '1' or stagioni == '1±0' then
if tipo == 'programma' then categoria = string.format('[[Categoria:Edizioni di programmi televisivi|%s]]', etichettanome)
elseif tipo == 'animata' then categoria = string.format('[[Categoria:Liste di episodi di serie animate|%s]]', etichettanome)
else categoria = string.format('[[Categoria:Liste di episodi di serie televisive|%s]]', etichettanome)
end
elseif tipo == 'programma' then categoria = string.format('[[Categoria:Edizioni %s %s|%02d]]', preposizione, etichettanome, i)
else categoria = string.format('[[Categoria:Stagioni %s %s|%02d]]', preposizione, etichettanome, i)
end
end