Module:Ep/Switcher

local p = {} -- function to take a given value of "ep" and return the episode's name and CxEE code function p.epSwitcher(frame, reference) -- Get ep value entered from template local ep   if reference and frame.args["ep"] then ep = frame.args["ep"] elseif reference and not isnotempty(frame.args["ep"]) then return " Undefined Episode ", "" elseif reference then ep = "0x00" elseif not isnotempty(frame.args[1]) then return "", "" else ep = frame.args[1] end -- the "part" variable is only used here for Trial of the Take episodes local part if reference then part = frame.args["part"] or nil end if not isnotempty(part) then part = "" end -- Get episode name and CxEE code

-- EPISODES if ep == "1" or ep == "01" or ep == "001" or ep == "Episode 1" or ep == "Episode 01" or ep == "Episode 001" or ep == "1x01" or ep == "Arrival" then epName, CxEE = "Arrival", "1x01" elseif ep == "2" or ep == "02" or ep == "002" or ep == "Episode 2" or ep == "Episode 02" or ep == "Episode 002" or ep == "1x02" or ep == "The Test" then epName, CxEE = "The Test", "1x02" elseif ep == "3" or ep == "03" or ep == "003" or ep == "Episode 3" or ep == "Episode 03" or ep == "Episode 003" or ep == "1x03" or ep == "Phoenix" then epName, CxEE = "Phoenix", "1x03" elseif ep == "4" or ep == "04" or ep == "004" or ep == "Episode 4" or ep == "Episode 04" or ep == "Episode 004" or ep == "1x04" or ep == "The Mysterious Stone" then epName, CxEE = "The Mysterious Stone", "1x04" elseif ep == "5" or ep == "05" or ep == "005" or ep == "Episode 5" or ep == "Episode 05" or ep == "Episode 005" or ep == "1x05" or ep == "Amazing Shadows" then epName, CxEE = "Amazing Shadows", "1x05" elseif ep == "6" or ep == "06" or ep == "006" or ep == "Episode 6" or ep == "Episode 06" or ep == "Episode 006" or ep == "1x06" or ep == "Spy Training" then epName, CxEE = "Spy Training", "1x06" elseif ep == "7" or ep == "07" or ep == "007" or ep == "Episode 7" or ep == "Episode 07" or ep == "Episode 007" or ep == "1x07" or ep == "1 Body - Head = Mystery" then epName, CxEE = "1 Body - Head = Mystery", "1x07" elseif ep == "8" or ep == "08" or ep == "008" or ep == "Episode 8" or ep == "Episode 08" or ep == "Episode 008" or ep == "1x08" or ep == "The Fate of a Crow" then epName, CxEE = "The Fate of a Crow", "1x08" elseif ep == "9" or ep == "09" or ep == "009" or ep == "Episode 9" or ep == "Episode 09" or ep == "Episode 009" or ep == "1x09" or ep == "A Snake in Humans Clothing" then epName, CxEE = "A Snake in Humans Clothing", "1x09" elseif ep == "10" or ep == "010" or ep == "Episode 10" or ep == "Episode 010" or ep == "1x10" or ep == "One Week" then epName, CxEE = "One Week", "1x10" elseif ep == "11" or ep == "011" or ep == "Episode 11" or ep == "Episode 011" or ep == "2x01" or ep == "Junior Ranchers" then epName, CxEE = "Junior Ranchers", "2x01" elseif ep == "12" or ep == "012" or ep == "Episode 12" or ep == "Episode 012" or ep == "2x02" or ep == "Penny for Your Thoughts" then epName, CxEE = "Penny for Your Thoughts", "2x02" elseif ep == "13" or ep == "013" or ep == "Episode 13" or ep == "Episode 013" or ep == "2x03" or ep == "Pie Hands!" then epName, CxEE = "Pie Hands!", "2x03" elseif ep == "14" or ep == "014" or ep == "Episode 14" or ep == "Episode 014" or ep == "2x04" or ep == "Lunch Study Club" then epName, CxEE = "Lunch Study Club", "2x04" elseif ep == "15" or ep == "015" or ep == "Episode 15" or ep == "Episode 015" or ep == "2x05" or ep == "Memories Revealed" then epName, CxEE = "Memories Revealed", "2x05" elseif ep == "16" or ep == "016" or ep == "Episode 16" or ep == "Episode 016" or ep == "2x06" or ep == "Welcome to The Den" then epName, CxEE = "Welcome to The Den", "2x06" elseif ep == "17" or ep == "017" or ep == "Episode 17" or ep == "Episode 017" or ep == "2x07" or ep == "Bonfires and Bodies" then epName, CxEE = "Bonfires and Bodies", "2x07" elseif ep == "18" or ep == "018" or ep == "Episode 18" or ep == "Episode 018" or ep == "2x08" or ep == "Midnight Fight" then epName, CxEE = "Midnight Fight", "2x08" elseif ep == "100" or ep == "Episode 100" or ep == "8x01" or ep == "Session Title Here" then epName, CxEE = "Session Title Here", "8x01" elseif ep == "101" or ep == "Episode 101" or ep == "8x02" or ep == "Session Title Here" then epName, CxEE = "Session Title Here", "8x02" elseif ep == "102" or ep == "Episode 102" or ep == "8x03" or ep == "Episode 102" then epName, CxEE = "Episode 102", "8x03" elseif ep == "103" or ep == "Episode 103" or ep == "8x04" or ep == "Episode 103" then epName, CxEE = "Episode 103", "8x04" elseif ep == "104" or ep == "Episode 104" or ep == "8x05" or ep == "Episode 104" then epName, CxEE = "Episode 104", "8x05" elseif ep == "105" or ep == "Episode 105" or ep == "8x06" or ep == "Episode 105" then epName, CxEE = "Episode 105", "8x06" elseif ep == "106" or ep == "Episode 106" or ep == "8x07" or ep == "Episode 106" then epName, CxEE = "Episode 106", "8x07" elseif ep == "107" or ep == "Episode 107" or ep == "8x08" or ep == "Episode 107" then epName, CxEE = "Episode 107", "8x08" elseif ep == "108" or ep == "Episode 108" or ep == "8x09" or ep == "Episode 108" then epName, CxEE = "Episode 108", "8x09" elseif ep == "109" or ep == "Episode 109" or ep == "8x10" or ep == "Episode 109" then epName, CxEE = "Episode 109", "8x10" elseif ep == "110" or ep == "Episode 110" or ep == "8x11" or ep == "Episode 110" then epName, CxEE = "Episode 110", "8x11" -- SPECIAL EPISODES ---

elseif ep == "14a" or ep == "014a" or ep == "Episode 14a" or ep == "Episode 014a" or ep == "Sx01" or ep == "Special 1" or ep == "Special 01" or ep == "Wendy Goes Home" then epName, CxEE = "Wendy Goes Home", "Sx01" else return ep, "" end return epName, CxEE end -- function to determine that a variable has a value function isnotempty(s) return s ~= nil and s~= '' end return p