Add capture month to collection and collection filters#20697
Conversation
This commit adds a new field to the collection structure to capture the month of photo capture. It also updates the collection filters to allow filtering based on the capture month. This will enable users to better organize and analyze their photos based on the time of capture.
|
You need to add DT_COLLECTION_MONTH_PROP to the Lua enums at the end of src/collect.c |
|
Thanks for the initial review @wpferguson @ralfbrown @TurboGit. Will address them once I'm getting back to the code. Until then I have the following general question to you: |
I think it is fine to have the months name here. Those could be reused anyway in other contexts. |
9e75167 to
ed1c869
Compare
408e1dc to
c4c60f3
Compare
|
Tested, works with Lua |
|
I just completed some intensive testing with both "collections" and "collection filters" without encountering any issue or regression. Is there anything specific I shall watch out for? |
|
Just tested. Lua is broken. |
How can I reproduce your test? |
|
Here's the script, create a new directory in your lua scripts named test (or whatever) and drop the script in there after removing the .txt extension. When you start it, it will filter for images taken in April. Stop it before you exit, so that it doesn't try and start again when you start darktable. The issue is at the end of src/libs/collect.c where the Lua enums are declared. Somehow it got lost in your latest round of changes/testing. |
|
Thanks, I can now reproduce the same error, but only while I was running a darktable binary w/o this change. With this change it works.
Hmmm, it is still there: |
|
Oops, maybe my error... Testing too may collection PRs.... EDIT: It works correctly. Sorry for the noise. |
TurboGit
left a comment
There was a problem hiding this comment.
Works for me, code ok now. Thanks!
|
this breaks old filmroll sort by folder. now if 2 levels are selected and order by folder instead of former |
Ups, sorry, I have never used filmrolls before, hence it slipped through. |
|
@MStraeten I cannot reproduce and I'm not sure if my changes have any influence on filmroll sorting. |
|
The issue seems to be in With /volumes/aa/2010 → display name aa/2010 Sorting by the display names gives aa/2010, bb/2012, but sorting by the full paths gives /users/bb/2012, /volumes/aa/2010 — the old behavior you expected. Does the following patch help? diff --git a/src/libs/collect.c b/src/libs/collect.c
index 139f9b2cc0..f2aac24254 100644
--- a/src/libs/collect.c
+++ b/src/libs/collect.c
@@ -168,7 +168,7 @@ static gint _sort_filmroll_rows(gconstpointer a, gconstpointer b)
{
const filmroll_row_t *ra = a;
const filmroll_row_t *rb = b;
- return g_ascii_strcasecmp(ra->folder, rb->folder);
+ return g_ascii_strcasecmp(ra->value, rb->value);
} |
|
sorry, you're right, i haven't seen the other collection affecting merge - |
|
i will file an issue for that so it can be properly tracked ... |
This PR adds the photo capture month to the "collections" and "collection filters" widgets, as requested on pixls: https://discuss.pixls.us/t/filtering-collection-on-capture-date-but-by-month-only/51621
This will enable users to better filter and analyze their photos based on the time of capture.
My typical use-case for this is finding suitable calendar pictures, given that I want them being taken in the same month as they should appear in the calendar.
A typical example for me is finding winter pictures, where I just want to filter for photos taken in December, January and February:

I have the following question to reviewers and other users:
Do you think we need the names of the months in there, or would numbers 00-12 be sufficient, given the necessity to translate those month names and their 3 character abbreviations?
Disclaimer: this code was co-created with Claude.