66 637
contributi
(ShortCode) |
mNessun oggetto della modifica |
||
Riga 57: | Riga 57: | ||
local args = frame:getParent().args | local args = frame:getParent().args | ||
return p._BuildShortCode(args) | return p._BuildShortCode(args) | ||
end | |||
-------------------------------------------------------------------------------- | |||
-- Build and return the list of shortcodes for series, season and episode | |||
-- | |||
-- @param {Frame} Info from MW session | |||
-- @return {string} The full incipit wikitext | |||
-------------------------------------------------------------------------------- | |||
function p.ShortCodeFromProdNo(frame) | |||
local ProdNo = frame.args[1] | |||
p._BuildShortCode("", string.sub(ProdNo, 1, 1), string.sub(ProdNo, 2)) | |||
end | end | ||
Riga 66: | Riga 78: | ||
-------------------------------------------------------------------------------- | -------------------------------------------------------------------------------- | ||
function p._BuildShortCode(Series, Season, Episode) | function p._BuildShortCode(Series, Season, Episode) | ||
local Templates = {"S0.E00", " s00e00", "s00e000"} | --local Templates = {"S0.E00", " s00e00", "s00e000"} | ||
local Templates = {"S%d.E%02d", " s%02de%02d", "s%02de%03d"} | |||
local Notations = {} | local Notations = {} | ||
Riga 78: | Riga 91: | ||
for _, Template in pairs(Templates) do | for _, Template in pairs(Templates) do | ||
mw.smw.set("Codice breve=" .. Series .. string.format(Template, Season, Episode)) | |||
end | end | ||
end | end |