From 554e833b1a39ede9aef234449fc8992435f10751 Mon Sep 17 00:00:00 2001 From: David Vazgenovich Shakaryan Date: Tue, 3 Feb 2026 22:42:26 -0800 Subject: support multiple sources --- catalogue.lua | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) (limited to 'catalogue.lua') diff --git a/catalogue.lua b/catalogue.lua index 7f83e82..425dc17 100644 --- a/catalogue.lua +++ b/catalogue.lua @@ -22,19 +22,20 @@ function mt:get(id) return self.data[id] end -function mt:_ensure_catchall(section_id) - local id = section_id .. ':category:catchall' +function mt:_ensure_catchall(src_id, section) + local id = src_id .. ':' .. section .. ':cat:catchall' local entry = self.data[id] if entry then return entry end return self:add({ - section = section_id, + src_id = src_id, + section = section, type = 'group', - group_type = 'category', + group_type = 'cat', id = id, - parent_id = section_id .. ':category:0', + parent_id = src_id .. ':' .. section .. ':cat:0', -- non-ascii symbol to sort near end name = '∗CATCHALL∗', }) @@ -56,7 +57,7 @@ function mt:add(entry) -- dump any entries referencing nonexistent categories into a single -- catchall category if not parent then - parent = self:_ensure_catchall(entry.section) + parent = self:_ensure_catchall(entry.src_id, entry.section) entry.parent_id = parent.id end -- cgit v1.2.3-70-g09d2