From 1e8e5940c536907c65a5fbf2b506b364d9cc9c8a Mon Sep 17 00:00:00 2001 From: mbergen Date: Fri, 16 Aug 2024 18:37:50 +0200 Subject: [PATCH] feat(infobox) Allow querying organizer prizepool by Title::baseText (#4552) --- components/infobox/commons/infobox_company.lua | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/components/infobox/commons/infobox_company.lua b/components/infobox/commons/infobox_company.lua index 08124790ccf..1d993ff91bf 100644 --- a/components/infobox/commons/infobox_company.lua +++ b/components/infobox/commons/infobox_company.lua @@ -10,6 +10,7 @@ local Class = require('Module:Class') local Flags = require('Module:Flags') local Links = require('Module:Links') local Locale = require('Module:Locale') +local Logic = require('Module:Logic') local Lua = require('Module:Lua') local ReferenceCleaner = require('Module:ReferenceCleaner') local Table = require('Module:Table') @@ -141,13 +142,14 @@ end ---@return string? function Company:_getOrganizerPrizepools() + local queryName = Logic.readBool(self.args.queryByBasename) and mw.title.getCurrentTitle().baseText or self.pagename local queryData = mw.ext.LiquipediaDB.lpdb('tournament', { conditions = - '[[organizers_organizer1::' .. self.pagename .. ']] OR ' .. - '[[organizers_organizer2::' .. self.pagename .. ']] OR ' .. - '[[organizers_organizer3::' .. self.pagename .. ']] OR ' .. - '[[organizers_organizer4::' .. self.pagename .. ']] OR ' .. - '[[organizers_organizer5::' .. self.pagename .. ']]', + '[[organizers_organizer1::' .. queryName .. ']] OR ' .. + '[[organizers_organizer2::' .. queryName .. ']] OR ' .. + '[[organizers_organizer3::' .. queryName .. ']] OR ' .. + '[[organizers_organizer4::' .. queryName .. ']] OR ' .. + '[[organizers_organizer5::' .. queryName .. ']]', query = 'sum::prizepool' })