Fandom

Kubera Wiki

Module:EpisodeLink

663pages on
this wiki
Add New Page
Talk0
-- This module is used by Template:Episode to create links to Naver and Webtoons.
-- 
-- This module needs to be updated every Monday when the new Naver episode is released
-- and every weekend-ish when the new LINE episodes are released (3x per week).
-- 
-- How webtoon numbering for Naver is calculated here (both are numbered the same):
-- 
-- Episodes 0 thru 32: episode # + 1
-- 34: Extra: The Daily Life of Goo Bera No. 1
-- Episodes 33 thru 50: episode # + 2
-- 53: Extra: The Daily Life of Goo Bera No. 2
-- Episodes 51 thru 68: episode # + 3
-- 72: Extra: The Daily Life of Goo Bera No. 3
-- Episodes 69 thru 100: episode # + 4
-- 105: Extra: Season 1 Epilogue
-- Episodes 2-0 thru 2-50: episode # + 106
-- 157: Extra: Q&A Special No. 1
-- Episodes 2-51 thru 2-100: episode # + 107
-- 208: Extra: Q&A Special No. 2
-- Episodes 2-101 thru 2-164: episode # + 108
-- 273: Extra: Punishment: included
-- Episodes 2-165 thru 2-?: episode # + 108
-- 290: Extra: Season 2 Epilogue
-- 
-- The link numbering for Webtoons is different. (Argh.)
-- We simply add 1 to the episode number.
-- 
-- Overlays: They are available for the following episodes:
-- (soon: 1-15 thru ?)
-- 2-97 thru current Korean episode
-- 
 
local p = {}
 
function p.GetNumber( frame )
    local LATEST_NAVER = 290    -- Update this on Mondays - most recent episode #
    local LATEST_WEBTOONS = 283 -- Update this on Mondays - most recent episode #
    local LATEST_OL = 289       -- Update this when a new overlay is released for the latest episode
    local site = frame.args[1]
    local release = frame.args[2]
    local LinkNumber = 0
    local LinkTxt = "Something went wrong."
 
    -- Get the link number.
    LinkNumber = tonumber( release )
 
    -- Return Naver link
    if (site == "naver") then
        if (LinkNumber <= LATEST_NAVER) then
            LinkTxt = "(Korean)<br />View on [http://comic.naver.com/webtoon/detail.nhn?titleId=131385&no=" .. LinkNumber .. " naver.com]"
            -- Overlay available?
            -- Release #204 = Episode 97, the first overlay episode.
            if (LinkNumber >= 204) and (LinkNumber <= LATEST_OL) then
                LinkTxt = LinkTxt .. "<br />* [[Overlay_translations|English overlay]] available"
            end
        else
            LinkTxt = "(Korean)<br />Not yet available on [http://comic.naver.com/webtoon/list.nhn?titleId=131385 naver.com]"
        end
    -- Return LINE link
elseif (site == "line") then
        -- Prologue, Goobera #1, Goobera #2, Goobera #3, Season 1 Review,
        -- Season 2 Prologue, Q&A, Hiatus, Season 2 Review,
        if (LinkNumber == 34) or (LinkNumber == 53) or (LinkNumber == 72) or (LinkNumber == 105) or (LinkNumber == 157) or (LinkNumber == 208) or (LinkNumber == 290) then
            LinkNumber = 0;
    	elseif (LinkNumber <= 33) then
	    	LinkNumber = LinkNumber - 0 -- do nothing
    	elseif (LinkNumber <= 52) then
    		LinkNumber = LinkNumber - 1
    	elseif (LinkNumber <= 71) then
    		LinkNumber = LinkNumber - 2
    	elseif (LinkNumber <= 104) then
    		LinkNumber = LinkNumber - 3
    	elseif (LinkNumber <= 156) then
    		LinkNumber = LinkNumber - 4
    	elseif (LinkNumber <= 207) then
    		LinkNumber = LinkNumber - 5
    	elseif (LinkNumber <= 289) then
    		LinkNumber = LinkNumber - 6
    	elseif (LinkNumber <= 10000) then
    	    LinkNumber = LinkNumber - 7
    	end
    	if     (LinkNumber == 0) then
    	    LinkTxt = "(English)<br />Not released by [http://webtoons.com/episodeList?titleNo=83 webtoons.com]"
        elseif (LinkNumber ~= 0) and (LinkNumber <= LATEST_WEBTOONS) then 
            LinkTxt = "(English)<br />View on [http://webtoons.com/viewer?titleNo=83&episodeNo=" .. LinkNumber .. " webtoons.com]"
        else
            LinkTxt = "(English)<br />Not yet available on [http://webtoons.com/episodeList?titleNo=83 webtoons.com]"
        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.