Skip to content

Update folder images count on whole hierarchy.#21331

Open
TurboGit wants to merge 2 commits into
masterfrom
po/folder-count
Open

Update folder images count on whole hierarchy.#21331
TurboGit wants to merge 2 commits into
masterfrom
po/folder-count

Conversation

@TurboGit

Copy link
Copy Markdown
Member

Closes #11799 #21282

@TurboGit TurboGit added this to the 5.8 milestone Jun 16, 2026
@TurboGit TurboGit added feature: enhancement current features to improve priority: low core features work as expected, only secondary/optional features don't scope: DAM managing files, collections, archiving, metadata, etc. release notes: pending labels Jun 16, 2026
@zisoft

zisoft commented Jun 16, 2026

Copy link
Copy Markdown
Collaborator

Funny, I was working on that topic today as well, but didn't have the time to finish :)

I think it would be nice to have that for DT_COLLECTION_PROP_TAG too, because tags also have a hierarchical structure.

@TurboGit

Copy link
Copy Markdown
Member Author

@zisoft : Probably yes, do you want to take this over (on top of this PR)? Otherwise I'll have a look no problem, let's just avoid duplicate work :) BTW, if you work on something do assign the issue to you.

@zisoft

zisoft commented Jun 17, 2026

Copy link
Copy Markdown
Collaborator

Ok, I have this ready, it is only a 2 lines edit :)

I tried to push a commit to this PR but that was rejected.

I have added this in review comments.

Comment thread src/libs/collect.c
child = parent2;
}
GtkTreeIter p;
gtk_tree_model_iter_parent(model, &p, &iter);

@zisoft zisoft Jun 17, 2026

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

you need to check for success here, otherwise gtk crashes if the node has no parent.

if(gtk_tree_model_iter_parent(model, &p, &iter))
  _update_parent_count(model, &p, count);

Comment thread src/libs/collect.c
index++;
// also add the item count to parents
if((property == DT_COLLECTION_PROP_DAY
|| property == DT_COLLECTION_PROP_FOLDERS

@zisoft zisoft Jun 17, 2026

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

add

|| property == DT_COLLECTION_PROP_TAG

here and is works for tags, too.

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@zisoft : Yes, that's what I have done locally and it works BUT we have an issue with the counting.

  • Select one image
  • Add tag "one"
  • Add tag "one|two"
  • Add tag "one|two|three"

Look for one in tag collection and select it.

  • On lighttable a single image displayed : GOOD
  • The count on top bar says 1 : GOOD
  • On the tag collection you have 2/2/1 : WRONG
- one (2)
   - two (2)
      - three (1)

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@zisoft
And this is hard to solve. For a folder we have a single image per folder, but here we have multiple tag on the same image. A solution would be to temporary have a map with already added image for each tag... Something I'd like to avoid as this extra complexity is not welcomed here. Any other idea?

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@TurboGit
you are right, that might get complicated.
I would suggest to merge the folder part, so we can continue on that base without hurry.

@TurboGit TurboGit changed the title Update folder count images on whole hierarchy. Update folder images count on whole hierarchy. Jun 17, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

feature: enhancement current features to improve priority: low core features work as expected, only secondary/optional features don't release notes: pending scope: DAM managing files, collections, archiving, metadata, etc.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[FR] folder view in collections module should display total number of images recursive

2 participants