Arrowverse Wiki
Advertisement
Arrowverse Wiki
Module documentation

This module has various functions described below and should only be utilized on templates. To call a module in a template, insert {{#invoke:RecentRelease|function name|various parameters}} onto the template.[ Data ]

For help on this module, please contact an administrator.
Visit Module:RecentRelease/doc to edit this text! (How does this work?)

--[[Category:Lua modules]]
--This Module is a work in progress and is currently not being used.--
local p = {}
local releaseData = mw.loadData('Module:RecentRelease/data')

function removeParen(fullTitle)
    local title={}
    local length= mw.ustring.len(fullTitle)
    local par={}
    if mw.ustring.find(fullTitle,'(',1,true)==nil
        then par=length
        else par=mw.ustring.find(fullTitle,'(',1,true)-2
    end
    local title=mw.ustring.sub(fullTitle,1,par)
    return title
end
function p.getInfo(frame)
    local obtaining= frame.args[1]
    local show= frame.args[2]
    if show=="The Flash (The CW)"
        then show="The Flash"
    end
    local result={}
    if releaseData[show]
        then if obtaining=="last"
            then result="{{Ep"
              .."|"
              ..releaseData[show][1]
              .."}}"
            else if obtaining=="next"
                then if releaseData[show][3]=="season"
                    then result="[[Season "
                        ..releaseData[show][6]
                        .." ("
                        ..show
                        ..")|Season "
                        ..releaseData[show][6]
                        .."]]"
                    else result="{{Ep"
                        .."|"
                        ..releaseData[show][3]
                        .."}}"
                    end
                else if obtaining=="date"
                    then result=releaseData[show][4]
                    end
                end
            end
        else result="[["
            .."Category:Broken S link|"
            ..show
            .."]]"
    end
    return frame:preprocess(result)
end

function p.MPinfo(frame)
    local obtaining= frame.args[1]
    local show= frame.args[2]
    if show=="The Flash (The CW)"
        then show="The Flash"
    end
    local result={}
    if releaseData[show]
        then if obtaining=="last"
            then result="[["
                        ..releaseData[show][1]
                        .."|<small><small>"
                        ..removeParen(releaseData[show][1])
                        .."</small></small>]]"
            else if obtaining=="next"
                then if releaseData[show][3]=="season"
                    then result="[[Season "
                        ..releaseData[show][6]
                        .." ("
                        ..show
                        ..")|<small><small>Season "
                        ..releaseData[show][6]
                        .."</small></small>]]"
                    else result="[["
                            ..releaseData[show][3]
                            .."|<small><small>"
                            ..removeParen(releaseData[show][3])
                            .."</small></small>]]"
                    end
                else if obtaining=="date"
                    then result=releaseData[show][4]
                    end
                end
            end
        else result="[["
            .."Category:Broken S link|"
            ..show
            .."]]"
    end 
    return frame:preprocess(result)
end
return p
Advertisement