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 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][4]=="season"
                    then result="[["
                        ..releaseData[show][2]
                        .." ("
                        ..show
                        ..")|"
                        ..releaseData[show][2]
                        .."]]"
                    else result="{{Ep"
                        .."|"
                        ..releaseData[show][2]
                        .."}}"
                    end
                else if obtaining=="date"
                    then result=releaseData[show][3]
                    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 local length= mw.ustring.len(releaseData[show][1])
                local par={}
                if mw.ustring.find(releaseData[show][1],'(',1,true)==nil
                    then par=length
                    else par=mw.ustring.find(releaseData[show][1],'(',1,true)-2
                end
                local title=mw.ustring.sub(releaseData[show][1],1,par)
                result="[["
                        ..releaseData[show][1]
                        .."|<small></small>"
                        ..title
                        .."</small></small>]]"
            else if obtaining=="next"
                then if releaseData[show][4]=="season"
                    then result="[["
                        ..releaseData[show][2]
                        .." ("
                        ..show
                        ..")|<small><small>"
                        ..releaseData[show][2]
                        .."</small></small>]]"
                    else local length= mw.ustring.len(releaseData[show][2])
                        local par={}
                        if mw.ustring.find(releaseData[show][2],'(',1,true)==nil
                            then par=length
                            else par=mw.ustring.find(releaseData[show][2],'(',1,true)-2
                        end
                        local title=mw.ustring.sub(releaseData[show][2],1,par)
                        result="[["
                            ..releaseData[show][2]
                            .."|<small></small>"
                            ..title
                            .."</small></small>]]"
                    end
                else if obtaining=="date"
                    then result=releaseData[show][3]
                    end
                end
            end
        else result="[["
            .."Category:Broken S link|"
            ..show
            .."]]"
    end 
    return frame:preprocess(result)
end
return p
Advertisement