-
-
Notifications
You must be signed in to change notification settings - Fork 3.2k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
feat: Non-primary images in a stack are sorted by file creation date #16346
base: main
Are you sure you want to change the base?
Conversation
Some of the server's asset repository methods also have stack relations and need to be updated to reflect the change. I don't like how the ordering is handled in the mobile app and would have liked it to be handled in the DB query. If it's ordered in one direction, then it should be possible to order it the other direction as well, no? |
This is the query:
|
Thank you @mertalev , it works like a charm now ! |
Nice! Once the asset repo queries are updated, this PR should be good to go. |
Reverted a change when sorting in the asset queries, I will look into it in more details tomorrow |
Description
Added sorting to the non primary images of a stack.
Since the mobile version behaves differently, the first one is extracted then the rest is sorted and both list are then reconcatenated.
This change addresses the issue of stack images ending up in a seemingly random order upon stacking.
Fixes #16250
How Has This Been Tested?
Stacks were made on 7 images with different dates, on both mobile and web version.
Stacks were created using increasingly recent dates (first one is the oldest file) and also using not the oldest as the first one to ensure it remained first after sorting on both mobile and web version
Stack more than 3 images, the first selected becomes the primary one
Navigate to stacked image
Confirm that the primary image remains first
Other images should be sorted by file creation date
Same test as above but selecting a file that is not the oldest or most recent of the stack, it should become the first in the stack viewer while the others are sorted
Screenshots (if appropriate)
File creation dates are as follow :
Checklist:
src/services
uses repositories implementations for database calls, filesystem operations, etc.src/repositories/
is pretty basic/simple and does not have any immich specific logic (that belongs insrc/services
)