FANDOM


-- 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)<br />View on [http://comic.naver.com/webtoon/detail.nhn?titleId=642653&no=" .. LinkNumber .. " Naver]"
            -- Season 1
        elseif (season == "1") then
                LinkTxt = "(Korean)<br />View on [http://comic.naver.com/webtoon/detail.nhn?titleId=616238&no=" .. LinkNumber .. " Naver]"
        else
            LinkTxt = "(Korean)<br />Not yet available on [http://comic.naver.com/webtoon/list.nhn?titleId=642653 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)<br />View on [http://webtoons.com/viewer?titleNo=92&episodeNo=" .. LinkNumber .. " LINE]"
        else
            LinkTxt = "(English)<br />Not yet available on [http://webtoons.com/episodeList?titleNo=92 LINE]"
        end
    end
    return LinkTxt
end
 
return p
--[[Category:Lua modules]]

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.