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 -- Season ONE EPISODES if ep == "S1E01" or ep == "01" or ep == "Episode 1" or ep == "Season 1 Episode 1" or ep == "1x01" or ep == "Our Story Begins..." then epName, CxEE = "Our Story Begins...", "1x01" elseif ep == "S1E02" or ep == "02" or ep == "Episode 2" or ep == "Season 1 Episode 2" or ep == "1x02" or ep == "Siege of Wahleur" then epName, CxEE = "Siege of Wahleur", "1x02" elseif ep == "S1E03" or ep == "03" or ep == "Episode 3" or ep == "Season 1 Episode 3" or ep == "1x03" or ep == "Bears and Bandits" then epName, CxEE = "Bears and Bandits", "1x03" elseif ep == "S1E04" or ep == "04" or ep == "Episode 4" or ep == "Season 1 Episode 4" or ep == "1x04" or ep == "Unexpected Allies" then epName, CxEE = "Unexpected Allies", "S1x04" elseif ep == "S1E05" or ep == "05" or ep == "Episode 5" or ep == "Season 1 Episode 5" or ep == "1x05" or ep == "Enter the Bluff" then epName, CxEE = "Enter the Bluff", "1x05" elseif ep == "S1E06" or ep == "06" or ep == "Episode 6" or ep == "Season 1 Episode 6" or ep == "1x06" or ep == "Redcap" then epName, CxEE = "Redcap", "1x06" elseif ep == "S1E07" or ep == "07" or ep == "Episode 7" or ep == "Season 1 Episode 7" or ep == "1x07" or ep == "A Wretched Day" then epName, CxEE = "A Wretched Day", "1x07" elseif ep == "S1E08" or ep == "08" or ep == "Episode 8" or ep == "Season 1 Episode 8" or ep == "1x08" or ep == "Hunting Party" then epName, CxEE = "Hunting Party", "1x08" elseif ep == "S1E09" or ep == "09" or ep == "Episode 9" or ep == "Season 1 Episode 9" or ep == "1x09" or ep == "Return to Sender" then epName, CxEE = "Return to Sender", "1x09" elseif ep == "S1E10" or ep == "10" or ep == "Episode 10" or ep == "Season 1 Episode 10" or ep == "2x01" or ep == "Welcome to Overock" then epName, CxEE = "Welcome to Overock", "1x10" elseif ep == "S1E11" or ep == "11" or ep == "Episode 11" or ep == "Season 1 Episode 11" or ep == "2x02" or ep == "Bazaar Machinations" then epName, CxEE = "Bazaar Machinations", "1x11" elseif ep == "S1E12" or ep == "12" or ep == "Episode 12" or ep == "Season 1 Episode 12" or ep == "2x03" or ep == "Senseless" then epName, CxEE = "Senseless", "1x12" elseif ep == "S1E13" or ep == "13" or ep == "Episode 13" or ep == "Season 1 Episode 13" or ep == "2x04" or ep == "Promises Made" then epName, CxEE = "Promises Made", "1x13" elseif ep == "S1E14" or ep == "14" or ep == "Episode 14" or ep == "Season 1 Episode 14" or ep == "2x05" or ep == "Promises Kept" then epName, CxEE = "Promises Kept", "1x14" elseif ep == "S1E15" or ep == "15" or ep == "Episode 15" or ep == "Season 1 Episode 15" or ep == "2x06" or ep == "Orphans and Mysteries" then epName, CxEE = "Orphans and Mysteries", "1x15" elseif ep == "S1E16" or ep == "16" or ep == "Episode 16" or ep == "Season 1 Episode 16" or ep == "2x07" or ep == "Meetings, Mires, and Monsters" then epName, CxEE = "Meetings, Mires, and Monsters", "1x16" elseif ep == "S1E17" or ep == "17" or ep == "Episode 17" or ep == "Season 1 Episode 17" or ep == "2x08" or ep == "Run" then epName, CxEE = "Run", "1x17" elseif ep == "S1E18" or ep == "18" or ep == "Episode 18" or ep == "Season 1 Episode 18" or ep == "2x09" or ep == "Fight for Your Life" then epName, CxEE = "Fight for Your Life", "1x18" elseif ep == "S1E19" or ep == "19" or ep == "Episode 19" or ep == "Season 1 Episode 19" or ep == "3x01" or ep == "Of Mice and Firbolgs" then epName, CxEE = "Of Mice and Firbolgs", "1x19" elseif ep == "S1E20" or ep == "20" or ep == "Episode 20" or ep == "Season 1 Episode 20" or ep == "3x02" or ep == "Highway to Yevel" then epName, CxEE = "Highway to Yevel", "1x20" elseif ep == "S1E21" or ep == "21" or ep == "Episode 21" or ep == "Season 1 Episode 21" or ep == "3x03" or ep == "Lich Way?" then epName, CxEE = "Lich Way?", "1x21" elseif ep == "S1E22" or ep == "22" or ep == "Episode 22" or ep == "Season 1 Episode 22" or ep == "3x04" or ep == "Family Matters" then epName, CxEE = "Family Matters", "1x22" elseif ep == "S1E23" or ep == "23" or ep == "Episode 23" or ep == "Season 1 Episode 23" or ep == "3x05" or ep == "Departing" then epName, CxEE = "Departing", "1x23" elseif ep == "S1E24" or ep == "24" or ep == "Episode 24" or ep == "Season 1 Episode 24" or ep == "3x06" or ep == "Arrival" then epName, CxEE = "Arrival", "1x24" elseif ep == "S1E25" or ep == "25" or ep == "Episode 25" or ep == "Season 1 Episode 25" or ep == "4x01" or ep == "Different Paths" then epName, CxEE = "Different Paths", "1x25" elseif ep == "S1E26" or ep == "26" or ep == "Episode 26" or ep == "Season 1 Episode 26" or ep == "4x02" or ep == "Downtime Research" then epName, CxEE = "Downtime Research", "1x26" elseif ep == "S1E27" or ep == "27" or ep == "Episode 27" or ep == "Season 1 Episode 27" or ep == "4x03" or ep == "The Trial of the Bastards" then epName, CxEE = "The Trial of the Bastards", "1x27" elseif ep == "S1E28" or ep == "28" or ep == "Episode 28" or ep == "Season 1 Episode 28" or ep == "4x04" or ep == "Where Demons Lie" then epName, CxEE = "Where Demons Lie", "1x28" elseif ep == "S1E29" or ep == "29" or ep == "Episode 29" or ep == "Season 1 Episode 29" or ep == "4x05" or ep == "Masqued Intentions" then epName, CxEE = "Masqued Intentions", "1x29" elseif ep == "S1E30" or ep == "30" or ep == "Episode 30" or ep == "Season 1 Episode 30" or ep == "4x06" or ep == "Shopping" then epName, CxEE = "Shopping", "1x30" elseif ep == "S1E31" or ep == "31" or ep == "Episode 31" or ep == "Season 1 Episode 31" or ep == "4x07" or ep == "Fey Night" then epName, CxEE = "Fey Night", "1x31" elseif ep == "S1E32" or ep == "32" or ep == "Episode 32" or ep == "Season 1 Episode 32" or ep == "4x08" or ep == "5x01" or ep == "Old Foes" then epName, CxEE = "Old Foes", "1x32" elseif ep == "S1E33" or ep == "33" or ep == "Episode 33" or ep == "Season 1 Episode 33" or ep == "4x09" or ep == "5x02" or ep == "Return to Overock" then epName, CxEE = "Return to Overock", "1x33" elseif ep == "S1E34" or ep == "34" or ep == "Episode 34" or ep == "Season 1 Episode 34" or ep == "4x10" or ep == "5x03" or ep == "Mysterious Benefactors" then epName, CxEE = "Mysterious Benefactors", "1x34" elseif ep == "S1E35" or ep == "35" or ep == "Episode 35" or ep == "Season 1 Episode 35" or ep == "4x11" or ep == "5x04" or ep == "To Kill a Wendigo" then epName, CxEE = "To Kill a Wendigo", "1x35" -- Season TWO EPISODES elseif ep == "S2E01" or ep == "36" or ep == "Episode 36" or ep == "Season 2 Episode 1" or ep == "6x01" or ep == "Answering the Call" then epName, CxEE = "Answering the Call", "2x01" elseif ep == "S2E02" or ep == "37" or ep == "Episode 37" or ep == "Season 2 Episode 2" or ep == "6x02" or ep == "The Morrison Job" then epName, CxEE = "The Morrison Job", "2x02" elseif ep == "S2E03" or ep == "38" or ep == "Episode 38" or ep == "Season 2 Episode 3" or ep == "6x03" or ep == "Sea of Sands" then epName, CxEE = "Sea of Sands","2x03" elseif ep == "S2E04" or ep == "39" or ep == "Episode 39" or ep == "Season 2 Episode 4" or ep == "6x04" or ep == "Mimicry" then epName, CxEE = "Mimicry","2x04" elseif ep == "S2E05" or ep == "40" or ep == "Episode 40" or ep == "Season 2 Episode 5" or ep == "6x05" or ep == "Debts Paid" then epName, CxEE = "Debts Paid","2x05" elseif ep == "S2E06" or ep == "41" or ep == "Episode 41" or ep == "Season 2 Episode 6" or ep == "6x06" or ep == "I Release You" then epName, CxEE = "I Release You","2x06" elseif ep == "S2E07" or ep == "42" or ep == "Episode 42" or ep == "Season 2 Episode 7" or ep == "6x07" or ep == "Pax Morvelle" then epName, CxEE = "Pax Morvelle","2x07" elseif ep == "S2E08" or ep == "43" or ep == "Episode 43" or ep == "Season 2 Episode 8" or ep == "6x08" or ep == "Platinum Promises" then epName, CxEE = "Platinum Promises","2x08" -- SPECIALS elseif ep == "S1E30a" or ep == "30a" or ep == "Episode 30a" or ep == "Special 1" or ep == "4x06a" or ep == "Sx01" or ep == "The Night Before Fey Night" then epName, CxEE = "The Night Before Fey Night", "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