Module:AVBrandList: Difference between revisions
Rewrite to query pre-computed category semantic properties instead of scanning all AV device pages (via update-page on MediaWiki MCP Server) |
Revert to category-based approach for consistency with CRT brands - requires brand category pages but is more reliable and scalable (via update-page on MediaWiki MCP Server) Tag: Manual revert |
||
| (2 intermediate revisions by the same user not shown) | |||
| Line 15: | Line 15: | ||
function p.list(frame) | function p.list(frame) | ||
local args = frame.args | |||
local linkType = trim(args.link) | |||
-- Query brand category pages (fast - only queries category pages, not all AV devices) | -- Query brand category pages (fast - only queries category pages, not all AV devices) | ||
local queryWikitext = | local queryWikitext = | ||
| Line 52: | Line 55: | ||
local output = {} | local output = {} | ||
for _, brand in ipairs(brandsList) do | for _, brand in ipairs(brandsList) do | ||
local templateCall = '{{AV brand entry|brand=' .. brand .. '}}' | local templateCall | ||
if linkType then | |||
templateCall = '{{AV brand entry|brand=' .. brand .. '|link=' .. linkType .. '}}' | |||
else | |||
templateCall = '{{AV brand entry|brand=' .. brand .. '}}' | |||
end | |||
table.insert(output, frame:preprocess(templateCall)) | table.insert(output, frame:preprocess(templateCall)) | ||
end | end | ||