Modulo:Controllo certificazioni: differenze tra le versioni

Contenuto cancellato Contenuto aggiunto
in caso di più template:Album nella stessa voce
miglioro performance
 
Riga 7:
if not year or year > 2008 then return end
local content = mw.title.getCurrentTitle():getContent()
content = content:gsub('{{ *[Aa]lbum[ \n]*|', '\r{{Album\n|') .. '\r'
local awards = { "d'oro", "di platino", "di diamante" }
-- non usare gsplit, è molto più lento di gmatch
for _, v in ipairs(awards) do
for subcontent in mwstring.text.gsplitgmatch(content, '{{ *[Aa]lbum[ Album\n]*|(.-)\r') do
local i = 1
for _, v in ipairs(awards) do
local pattern = '^(.-)|%s*numero dischi ' .. v .. '%s*=(.+)$'
local pre, post = ('|' .. subcontent):match(pattern)
for subcontent in mw.text.gsplit(content, '{{ *[Aa]lbum[ \n]*|') do
if i ~= 1post then
-- evita falsi positivi col template Brano musicale
local pre, post = ('|' .. subcontent):match(pattern)
if postpre:match('{{ *[Bb]rano musicale *|') then break end
post = post:sub(1, 2000)
-- evita falsi positivi col template Brano musicale
local in = 10
if pre:match('{{ *[Bb]rano musicale *|') then break end
for s, c in string.gmatch(post, '(.-)([|{}]+)') do
post = post:sub(1, 2000)
localif ns:match('FIMI') = 0then
return cat
for s, c in string.gmatch(post, '(.-)([|{}]+)') do
end
if s:match('FIMI') then
n = n -+ select(2, c:gsub('}}{{', ''))
return cat
n = n - select(2, c:gsub('}}', ''))
end
if n == n0 + select(2,and c:gsubmatch('{{', '|$')) or n < 0 then
break
n = n - select(2, c:gsub('}}', ''))
if n == 0 and c:match('|$') or n < 0 then
break
end
end
end
end
i = i + 1
end
end