Skip to content
Draft
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
17 changes: 17 additions & 0 deletions lua/wikis/commons/Infobox/League.lua
Original file line number Diff line number Diff line change
Expand Up @@ -332,6 +332,23 @@ function League:_createUpcomingMatches()
return nil
end

---@return boolean
local isFinished = function()
if DateExt.isDefaultTimestamp(self.data.endDate) or not self.data.endDate then
return false
end
local endDate = DateExt.readTimestamp(self.data.endDate)
-- assume an event is finished 2 days after the enddate latest
-- 1 day for finishing the day of the enddate
-- 1 day for potential timezone offsets plus events reaching into the next day from time to time (i.e. over midnight)
return endDate + DateExt.daysToSeconds(2) < DateExt.getCurrentTimestamp()
Copy link
Collaborator

@mbergen mbergen Jan 11, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Me might as well add the second day into the phase calculation in Module:Tournament, and just use the phase here

Nevermind, the phase is used e.g. on mainpage matchticker and should be rather tight

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

and the entire point of this change is to avoid the query the calc of phase comes after the query...

Think you are confusing match and tournament phase, i was talking about the latter, which could be used from https://github.com/Liquipedia/Lua-Modules/pull/6958/changes#diff-c785af01ddd309e4adb29a541146f4098cb8d84d697b7e051cbc9415c1458427R305

end

-- avoid the query for finished events
if isFinished() then
return nil
end

local result = Logic.tryCatch(
function()
local matchTicker = MatchTicker{
Expand Down
Loading