Jump to content

Module:Infobox television season disambiguation check

Permanently protected module
From Wikipedia, the free encyclopedia
This is an old revision of this page, as edited by MusikBot II (talk | contribs) at 17:59, 6 June 2019 (Protected "Module:Infobox television season disambiguation check": High-risk template or module (more info) ([Edit=Require template editor access] (indefinite) [Move=Require template editor access] (indefinite))). The present address (URL) is a permanent link to this revision, which may differ significantly from the current revision.

-- This module requires the use of the following modules.
local getArgs = require('Module:Arguments').getArgs
local validateDisambiguation = require('Module:Television infoboxes disambiguation check')

local p = {}

local validDisambiguationPatternList = {
	validateDisambiguation.DisambiguationPattern{pattern = "^(%d+) TV series, season (%d+)$", type = 4}, --"VALIDATION_TYPE_YEAR_SEASON_NUMBER"
	validateDisambiguation.DisambiguationPattern{pattern = "^(%d+) TV series, series (%d+)$", type = 4},
	validateDisambiguation.DisambiguationPattern{pattern = "^([%D]+) season (%d+)$", type = 5}, -- "VALIDATION_TYPE_COUNTRY_SEASON_NUMBER"
	validateDisambiguation.DisambiguationPattern{pattern = "^([%D]+) series (%d+)$", type = 5},
	validateDisambiguation.DisambiguationPattern{pattern = "^([%D]+) season$", type = 7}, --"VALIDATION_TYPE_COUNTRY_SEASON"
	validateDisambiguation.DisambiguationPattern{pattern = "^season (%d+)$", type = 6}, -- "VALIDATION_TYPE_SEASON_NUMBER"
	validateDisambiguation.DisambiguationPattern{pattern = "^series (%d+)$", type = 6}
}

local exceptionList = {}

local otherInfoboxList = {
	["^%D+ TV series$"] = "[[Category:Television articles using incorrect infobox|T]]",
	["^%d+ TV series$"] = "[[Category:Television articles using incorrect infobox|T]]",
}

-- Currently unused lists that need to be passed to the base module.
local validDisambiguationTypeList = {}

local function _main(args)
	local title = args[1]
	return validateDisambiguation.main(title, validDisambiguationTypeList, validDisambiguationPatternList, exceptionList, otherInfoboxList)
end

function p.main(frame)
	local args = getArgs(frame)
	local category, debugString = _main(args)
	return category
end

function p.test(frame)
	local args = getArgs(frame)
	local category, debugString = _main(args)
	return debugString
end

return p