Compare commits
2 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
c1629ee719 | ||
|
|
b32216d94e |
@@ -356,38 +356,6 @@ local function has_group_leader_tag(image)
|
|||||||
return result
|
return result
|
||||||
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)
|
|
||||||
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
|
-- handle grouping changes in the UI
|
||||||
|
|
||||||
local function group_exists(group_leader)
|
local function group_exists(group_leader)
|
||||||
@@ -470,6 +438,38 @@ local function add_to_group(image, group_leader)
|
|||||||
end
|
end
|
||||||
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)
|
local function check_and_remove_empty_group_data(group_tag)
|
||||||
if not group_tag then
|
if not group_tag then
|
||||||
return -- handle duplicate getting deleted
|
return -- handle duplicate getting deleted
|
||||||
|
|||||||
Reference in New Issue
Block a user