Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions lua/wikis/commons/Infobox/League.lua
Original file line number Diff line number Diff line change
Expand Up @@ -550,6 +550,7 @@ function League:_setLpdbData(args, links)
summary = self:seoText(args),
extradata = {
series2 = args.series2 and mw.ext.TeamLiquidIntegration.resolve_redirect(args.series2) or nil,
hideontournamentsticker = Logic.readBool(args.hide_on_tournaments_ticker),
},
}

Expand Down
6 changes: 4 additions & 2 deletions lua/wikis/commons/TournamentsSummaryTable.lua
Original file line number Diff line number Diff line change
Expand Up @@ -145,14 +145,16 @@ end
---@return table[]
function TournamentsSummaryTable._getTournaments(conditionType, sort, order, limit)
local data = mw.ext.LiquipediaDB.lpdb('tournament', {
query = 'pagename, name, tickername, icon, icondark, startdate, enddate, series',
query = 'pagename, name, tickername, icon, icondark, startdate, enddate, series, extradata',
conditions = TournamentsSummaryTable._buildConditions(conditionType),
order = sort .. 'date ' .. order .. ', liquipediatier asc, name asc',
limit = limit,
})

if type(data) == 'table' and data[1] then
return data
return Array.filter(data, function(tournament)
return not (tournament.extradata or {}).hideontournamentsticker
end)
end

return {}
Expand Down
10 changes: 9 additions & 1 deletion lua/wikis/commons/Widget/Tournaments/Ticker.lua
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,15 @@ function TournamentsTickerWidget:render()
['qualifier'] = self.props.modifierTypeQualifier,
}

---@param tournament StandardTournament
---@return boolean
local function isNotHidden(tournament)
return not tournament.extradata.hideontournamentsticker
end

local currentTimestamp = DateExt.getCurrentTimestamp()
---@param tournament StandardTournament
---@return boolean
local function isWithinDateRange(tournament)
local modifiedThreshold = tierThresholdModifiers[tournament.liquipediaTier] or 0
local modifiedCompletedThreshold = tierTypeThresholdModifiers[tournament.liquipediaTierType] or modifiedThreshold
Expand Down Expand Up @@ -79,7 +87,7 @@ function TournamentsTickerWidget:render()
:add(Condition.Node(Condition.ColumnName('liquipediatiertype'), Condition.Comparator.eq, '!Points'))

local allTournaments = Tournament.getAllTournaments(lpdbFilter, function(tournament)
return isWithinDateRange(tournament)
return isNotHidden(tournament) and isWithinDateRange(tournament)
end)

local function filterByPhase(phase)
Expand Down
Loading