Fandom

Narutopedia

Module:MediaCleaner

6,207pages on
this wiki
Add New Page
Talk0

Ad blocker interference detected!


Wikia is a free-to-use site that makes money from advertising. We have a modified experience for viewers using ad blockers

Wikia is not accessible if you’ve made further modifications. Remove the custom ad blocker rule(s) and the page will load as expected.

local p = {}
 
function p.clean(frame)
	local arg, media = frame:getParent().args[1], {}
    arg = string.gsub(arg, " ", "") -- Remove spaces
 
	local m, n = mw.text.split(arg, ","), {}
 
	for _, l in ipairs(m) do
        if (not media[l]) then
            n[#n+1] = l
            media[l] = true
        end
    end
 
	if #media > 3 then
	    if media.Anime or media.Manga then return "" end
    elseif #media == 3 and media.Manga then return "" 
    else
        if media.Anime and media.Manga then return "" end
        if media.Moviecanon and media.Manga then return "" end
        if media.Movie and media.Game then return "Movie" end
        if media.Anime and media.Novel then return "Anime" end
        if media.Anime then return "Anime" end
        if media.Manga then return "Manga" end
        if media.Moviecanon then return "Movie" end
    end
 
    arg = table.concat(n, ",")
	arg = string.gsub(string.gsub(arg, "%(", ""), "%)", "")
	return arg
end
 
return p

Also on Fandom

Random Wiki