frontend: route all photo queries through sidecar timeline proxy

- listPhotos → /api/sidecar/timeline (was /photos)
- countPhotos → /api/sidecar/timeline (was /photos)
- hasPhotosMatching → /api/sidecar/timeline (was /photos)
- Sidecar handler forwards X-Count header for countPhotos()
- Sidecar adjusts X-Count to reflect post-filtered count
This commit is contained in:
2026-06-06 20:17:13 +02:00
parent 7df1c04c0f
commit 14a1b4e54e
2 changed files with 9 additions and 3 deletions

View File

@@ -39,6 +39,10 @@ func handlePhotos(pp *ppClient) gin.HandlerFunc {
// If the user has no BasePath (admin/empty), return as-is.
if basePath == "" {
// Forward PhotoPrism's X-Count header for countPhotos().
if count := resp.Header.Get("X-Count"); count != "" {
c.Header("X-Count", count)
}
c.JSON(http.StatusOK, photos)
return
}
@@ -62,6 +66,8 @@ func handlePhotos(pp *ppClient) gin.HandlerFunc {
}
}
// Forward X-Count header adjusted to the filtered count.
c.Header("X-Count", itoa(len(filtered)))
c.JSON(http.StatusOK, filtered)
}
}