2 Commits

Author SHA1 Message Date
Bill Ferguson
c1629ee719 official/group_persistence - backport fix 2026-04-18 15:30:13 -04:00
Bill Ferguson
b32216d94e official/group_persistence - backport fix for collection shortcut 2026-04-18 14:51:30 -04:00

View File

@@ -356,38 +356,6 @@ local function has_group_leader_tag(image)
return result
end
local function build_group(leader)
if not has_group_leader_tag(leader) then
add_group_leader(leader)
end
for _, image in ipairs(leader:get_group_members()) do
if not has_group_tag(image) then
add_to_group(image)
end
end
end
local function process(image_set)
local images
if image_set == "collection" then
images = dt.collection
else
images = dt.gui.selection()
if #images == 0 then
images = dt.gui.action_images
end
end
for _, image in ipairs(images) do
if is_group_leader(image) then
build_group(image)
end
end
end
-- handle grouping changes in the UI
local function group_exists(group_leader)
@@ -470,6 +438,38 @@ local function add_to_group(image, group_leader)
end
end
local function build_group(leader)
if not has_group_leader_tag(leader) then
add_group_leader(leader)
end
for _, image in ipairs(leader:get_group_members()) do
if not has_group_tag(image) then
add_to_group(image, leader)
end
end
end
local function process(image_set)
local images
if image_set == "collection" then
images = dt.collection
else
images = dt.gui.selection()
if #images == 0 then
images = dt.gui.action_images
end
end
for _, image in ipairs(images) do
if is_group_leader(image) then
build_group(image)
end
end
end
local function check_and_remove_empty_group_data(group_tag)
if not group_tag then
return -- handle duplicate getting deleted