Bug 438961 - Searching images created on a given day of every month is not possible
Summary: Searching images created on a given day of every month is not possible
Status: RESOLVED FIXED
Alias: None
Product: digikam
Classification: Applications
Component: Searches-Advanced (other bugs)
Version First Reported In: 7.2.0
Platform: Appimage Linux
: NOR wishlist
Target Milestone: ---
Assignee: Digikam Developers
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2021-06-20 19:12 UTC by Johannes
Modified: 2021-06-21 16:30 UTC (History)
1 user (show)

See Also:
Latest Commit:
Version Fixed/Implemented In: 7.3.0
Sentry Crash Report:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Johannes 2021-06-20 19:12:35 UTC
SUMMARY
In Advanced Search, selection of a day is not possible when Every Month is selected.

STEPS TO REPRODUCE
1. Create an Advanced Search with Picture Properties > Month/Day Return items from a month or a day of the month -> Every Month


OBSERVED RESULT
Selection of Day is not possible

EXPECTED RESULT

Selection of Day is possible and search returns only images created e.g. on the 5th.



SOFTWARE/OS VERSIONS
Linux/KDE Plasma: Ubuntu Linux 18.04.05

KDE Frameworks 5.78.0
Qt 5.14.2 (built against 5.14.2)


ADDITIONAL INFORMATION

The Advanced Search dialog seems to be not very flexible enough. What about allowing users to directly write the WHERE-part of the SQL?
Comment 1 Maik Qualmann 2021-06-20 19:35:46 UTC
Returning a specific day from the collection is currently not implemented. This specific date operation cannot be implemented by every user with a simple WHERE clause.

Maik
Comment 2 Johannes 2021-06-20 19:59:16 UTC
The WHERE clause for month and day is for example
WHERE Images.status=1 AND (  ( (STRFTIME('%m%d', ImageInformation.creationDate) = ?) )  );" 
 (QVariant(QString, "0720"))

So by leaving out %m and using a String like "20" it should work.
Comment 3 Maik Qualmann 2021-06-20 20:48:20 UTC
STRFTIME only works with SQLite, MySQL requires different SQL code.

Maik
Comment 4 Maik Qualmann 2021-06-21 16:30:01 UTC
Git commit 1282cb7e6200750f0bdc562fbf6ea3f6d51777ff by Maik Qualmann.
Committed on 21/06/2021 at 16:29.
Pushed by mqualmann into branch 'master'.

add search for a day from the collection
FIXED-IN: 7.3.0

M  +2    -1    NEWS
M  +18   -5    core/libs/database/item/query/itemquerybuilder.cpp
M  +1    -17   core/utilities/searchwindow/searchfields.cpp
M  +0    -4    core/utilities/searchwindow/searchfields.h

https://invent.kde.org/graphics/digikam/commit/1282cb7e6200750f0bdc562fbf6ea3f6d51777ff