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
Albums: Add option to sort albums/states chronologically by date of assigned photos #3832
base: develop
Are you sure you want to change the base?
Conversation
My apologies for the late feedback on your changes! I hope you had a good start into the new year :) Since empty albums should not have an oldest or newest date, it might be a good idea to change the entity time values to pointers (so that they can be set to nil if needed): AlbumOldest *time.Time `json:"Oldest" yaml:"Oldest"`
AlbumNewest *time.Time `json:"Newest" yaml:"Newest"` Based on the currently implemented functionality, it would seem best to (also) update the new album date fields in the following place (or move this function to the entity package)? photoprism/internal/query/albums.go Lines 107 to 124 in e03dbe5
This function is automatically executed in regular intervals by the meta worker so that the updates happen automatically in the background: photoprism/internal/photoprism/moments.go Line 264 in e03dbe5
That's particularly useful for albums that are based on search filters, e.g. the "state", "folder" and "moment" types (for manually managed albums, an additional update statement can be run in the entity model so that these albums are updated immediately after performing changes). The SQL query needed to determine and update the dates in photoprism/internal/query/albums.go Lines 32 to 33 in e03dbe5
However, from what I know, we only need to take care of the "album", "state" and "folder" types, and for those it should be possible to determine the oldest and newest date without running a regular search query for each individual album, which might otherwise cause quite a bit of overhead: photoprism/internal/query/albums.go Line 61 in e03dbe5
Happy to answer any follow-up questions you may have 👍 |
#3763