From 5bf96a36917767c6a50a2fa5af8799c07b77c800 Mon Sep 17 00:00:00 2001 From: ElectricalBoy <15651807+ElectricalBoy@users.noreply.github.com> Date: Tue, 13 Jan 2026 14:43:19 +0900 Subject: [PATCH 1/3] replace MGI with StandardTournament --- lua/wikis/commons/MatchPage/Base.lua | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/lua/wikis/commons/MatchPage/Base.lua b/lua/wikis/commons/MatchPage/Base.lua index c15c1a2f86d..5b7d549656e 100644 --- a/lua/wikis/commons/MatchPage/Base.lua +++ b/lua/wikis/commons/MatchPage/Base.lua @@ -18,9 +18,9 @@ local Operator = Lua.import('Module:Operator') local String = Lua.import('Module:StringUtils') local Table = Lua.import('Module:Table') local TeamTemplate = Lua.import('Module:TeamTemplate') +local Tournament = Lua.import('Module:Tournament') local HighlightConditions = Lua.import('Module:HighlightConditions') -local MatchGroupInputUtil = Lua.import('Module:MatchGroup/Input/Util') local MatchGroupUtil = Lua.import('Module:MatchGroup/Util/Custom') local DisplayHelper = Lua.import('Module:MatchGroup/Display/Helper') @@ -346,9 +346,9 @@ function BaseMatchPage:renderGame(game) end ---@protected ----@return table +---@return StandardTournamentPartial function BaseMatchPage:getMatchContext() - return MatchGroupInputUtil.getTournamentContext(self.matchData) + return Tournament.partialTournamentFromMatch(self.matchData) end ---@protected From dcf74d99f0fa4726aea989722ab722f9ac800ec7 Mon Sep 17 00:00:00 2001 From: ElectricalBoy <15651807+ElectricalBoy@users.noreply.github.com> Date: Tue, 13 Jan 2026 14:46:31 +0900 Subject: [PATCH 2/3] cleanup --- lua/wikis/commons/MatchPage/Base.lua | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/lua/wikis/commons/MatchPage/Base.lua b/lua/wikis/commons/MatchPage/Base.lua index 5b7d549656e..0c33e221e36 100644 --- a/lua/wikis/commons/MatchPage/Base.lua +++ b/lua/wikis/commons/MatchPage/Base.lua @@ -239,7 +239,7 @@ end function BaseMatchPage:makeDisplayTitle() local team1data = (self.opponents[1] or {}).teamTemplateData local team2data = (self.opponents[2] or {}).teamTemplateData - local tournamentName = self.matchData.tickername + local tournamentName = self:getMatchContext().displayName if Logic.isEmpty(team1data) and Logic.isEmpty(team2data) then return String.isNotEmpty(tournamentName) and 'Match in ' .. tournamentName or '' @@ -356,7 +356,7 @@ end function BaseMatchPage:getTournamentIcon() return IconImage{ imageLight = self:getMatchContext().icon, - imageDark = self:getMatchContext().icondark, + imageDark = self:getMatchContext().iconDark, size = '50x32px', } end From 9b17dc570937872cb59e11f2238284887a8f1416 Mon Sep 17 00:00:00 2001 From: ElectricalBoy <15651807+ElectricalBoy@users.noreply.github.com> Date: Tue, 13 Jan 2026 15:56:11 +0900 Subject: [PATCH 3/3] memoize getMatchContext --- lua/wikis/commons/MatchPage/Base.lua | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/lua/wikis/commons/MatchPage/Base.lua b/lua/wikis/commons/MatchPage/Base.lua index 0c33e221e36..78ab3aacbd7 100644 --- a/lua/wikis/commons/MatchPage/Base.lua +++ b/lua/wikis/commons/MatchPage/Base.lua @@ -12,6 +12,7 @@ local CharacterIcon = Lua.import('Module:CharacterIcon') local Class = Lua.import('Module:Class') local Countdown = Lua.import('Module:Countdown') local DateExt = Lua.import('Module:Date/Ext') +local FnUtil = Lua.import('Module:FnUtil') local Logic = Lua.import('Module:Logic') local Links = Lua.import('Module:Links') local Operator = Lua.import('Module:Operator') @@ -346,10 +347,11 @@ function BaseMatchPage:renderGame(game) end ---@protected +---@param self BaseMatchPage ---@return StandardTournamentPartial -function BaseMatchPage:getMatchContext() +BaseMatchPage.getMatchContext = FnUtil.memoize(function (self) return Tournament.partialTournamentFromMatch(self.matchData) -end +end) ---@protected ---@return Widget