Module:EpisodeLink

-- This module was taken and adapted from the Kubera Wiki -- -- -- -- This module needs to be updated every Tuesday when the new Naver episode is released and Wednesday when the new LINE episodes is released. -- -- How webtoon numbering for Naver is calculated: -- Season 1 Prologue (Episode 0): 1 -- Episodes 1 to 49: episode # + 1 -- Season 2 Prologue (Episode 2-0): 1 -- Episode 2-1 onwards: episode # + 1 -- -- -- How webtoon numbering for LINE is calculated: -- Season 1 Prologue (Episode 0): 1 -- Episodes 1 to 3: episode # + 1 -- Episodes 4 to 49: episode # + 2 -- Season 2 Prologue (Episode 2-0): 52 -- Episodes 2-1 onwards: episode # + 52 --

local p = {}

function p.GetNumber( frame ) local S1_NAVER = 49 local LATEST_NAVER = 80 -- Update this on Tuesdays - most recent episode # local LATEST_WEBTOONS = 80 -- Update this on Wednesdays - most recent episode # local site = frame.args[1] local season = frame.args[2] local episode = frame.args[3] local LinkNumber = 0 local LinkTxt = "Something went wrong."

-- Get the link number. episode = tonumber( episode )

-- Return Naver link if (site == "naver") then if (season == "2") then LinkNumber = episode + 1 elseif (season == "1") then LinkNumber = episode + 1 end if (season == "2") and (episode <= LATEST_NAVER) then LinkTxt = "(Korean) View on [http://comic.naver.com/webtoon/detail.nhn?titleId=642653&no=" .. LinkNumber .. " Naver]" -- Season 1 elseif (season == "1") then LinkTxt = "(Korean) View on [http://comic.naver.com/webtoon/detail.nhn?titleId=616238&no=" .. LinkNumber .. " Naver]" else LinkTxt = "(Korean) Not yet available on Naver" end end -- Return LINE link if (site == "line") then if (season == "1") then if (episode <= 3) then LinkNumber = episode + 1 else LinkNumber = episode + 2 end elseif (season == "2") then LinkNumber = episode + 52 end if (season == "1") or (episode <= LATEST_WEBTOONS) then LinkTxt = "(English) View on [http://webtoons.com/viewer?titleNo=92&episodeNo=" .. LinkNumber .. " LINE]" else LinkTxt = "(English) Not yet available on LINE" end end return LinkTxt end

return p --