mirror of
https://github.com/photoprism/photoprism.git
synced 2026-03-02 22:57:18 -05:00
API: GET albums should return photo count for additional album types #1981
Labels
No labels
ai
android
api
auth
awesome
bug
bug
ci
cli
config
database
declined
deprecated
docker
docs 📚
documents
duplicate
easy
enhancement
enhancement
enhancement
epic
faces
feedback wanted
frontend
hacktoberfest
help wanted
idea
in-progress
incomplete
index
invalid
ios
labels
live
live
low-priority
macos
member-feature
metadata
mobile
nas
needs-analysis
no-coding-required
no-coding-required
observability
performance
places
please-test
plus-feature
priority
pro-feature
question
raspberry-pi
raw
released
released
released
research
resolved
security
sharing
tested
tests
third-party-issue
thumbnails
upgrade
upstream-issue
ux
vector
video
waiting
won't fix
won't fix
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
starred/photoprism#1981
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Originally created by @ad-on-is on GitHub (Dec 12, 2023).
When fetching
/albums?count=10&type=monththe field PhotoCount is 0. Same goes for type=moments.I'd expect it to have the number of Photos in that album.
Do I have to append something to the query?
@lastzero commented on GitHub (Dec 12, 2023):
This counter is currently only available for manually managed albums, as the number of matches for albums based on search filters is highly dynamic.
@ad-on-is commented on GitHub (Dec 12, 2023):
That's a bummer. How do manual albums handle this? Is that field modified in the DB each time photos are added/deleted to an album? Would there be a performance issue by adding a subquery to fetch the count, to make it work across all albums?
@lastzero commented on GitHub (Dec 12, 2023):
See this SQL query for details:
github.com/photoprism/photoprism@467f7b1585/internal/search/albums.go (L33-L37)You are welcome to send a PR with improvements if it does not significantly affect the performance for users with many albums!