Commit graph

59 commits

Author SHA1 Message Date
Keith Martin
b6687b6c29
Tests: Improve isolation and add fixes #5263
* Tests: fix random selection of deleted record causing test failure
* Tests: fix test folders being left after test
* Tests: ensure that required records are available
* Tests: make each package execute against it's own testdata folder to ensure no interpackage test failures
* Tests: add unit tests of CleanupTestFolder
* Tests:  Allow defer in TestMain
* Tests: rename testMain to runTestMain
2026-07-12 05:47:21 +02:00
Cathie Integra
3f096a592b Links: Use canonical trailing-slash form for website URLs 2026-06-24 17:20:30 +02:00
Michael Mayer
bc327016ad Metadata: Add Camera Make and Model updates via CLI & API #5663 #5656
Mirror the lens make/model editing surface for cameras: entity UpdateMakeModel/SaveForm, form validation, query, search, the GET/PUT /api/v1/cameras endpoints, and the cameras CLI command, plus a cameras ACL resource and scope.

Also tidy the lens surface for parity: self-validating SaveForm, empty make/model guard, X-Count search header, service-role grant, the empty-id/slug docs, and order cameras before lenses everywhere.
2026-06-15 09:25:44 +00:00
Keith Martin
c3eda657fd
Metadata: Add Lens Make and Model updates via CLI & API #5644 #5656
Adds the ability to override a lens's Make/Model (e.g. fixing Pentax lenses that ExifTool decodes as `4 38`) via a new photoprism lenses update CLI command and a `PUT /api/v1/lenses/:id endpoint`, plus a `GET /api/v1/lenses` search endpoint, a new lenses ACL resource, and an lenses ls list command.
2026-06-15 09:37:32 +02:00
Michael Mayer
8b09cfe76e Photos: Limit by-UID and batch photo edits to the session scope
Single-photo update/approve/set-primary and batch archive/restore/approve/private/delete now apply the same shared-scope visibility predicate as photo search, so by-UID and bulk edits stay consistent with album updates and never act on content outside the session's shared scope. Visibility is evaluated against both the client and user role for client sessions. Full-access sessions skip the check with no database query via PhotoSessionSeesEverything / SelectedPhotoUIDsForSession.
2026-06-10 19:49:27 +02:00
Michael Mayer
d6249107a0 Moments: Dedup folder albums by filter, not slug #5615 #5614
Folder album slugs are not unique identities: long nested paths are
truncated to ClipSlug runes and slug.Make drops emoji, so distinct
sibling folders can share one album_slug. Deduplicate folder albums by
album_filter (the serialized path) instead, and keep slug matching only
for non-folder album types.

This stops RemoveDuplicateMoments from deleting legacy folder rows with
an empty album_path that merely share a truncated slug, which the
indexer then recreated on every run. The empty/NULL album_path escape
hatch in the previous byte-exact path guard no longer applies.
2026-06-01 11:18:30 +00:00
Michael Mayer
c569c02e9e Moments: Guard folder album dedup against slug collisions #5615 #5614
Legacy folder slugs drop emoji (slug.Make), so two siblings collide on the
VARBINARY album_slug and RemoveDuplicateMoments deleted one each pass while
the indexer recreated it. Skip folder albums whose album_path differs
byte-exact via HEX(), which compares the same on MariaDB and SQLite.
2026-05-31 00:23:12 +00:00
Michael Mayer
763757cc4b API: Scope file lookup and zip selection to the session
GetFile and the zip selection now limit results to the session's shared scope via the shared search helpers, consistent with photo search and in preparation for upcoming sharing features. No change for full-access sessions.
2026-05-29 07:04:47 +02:00
Michael Mayer
e39f9f20a6 Index: Reassign primary when current primary is deleted #5625
FixPrimaries counted soft-deleted files as primaries, so a photo whose
primary was deleted kept photo_quality = -1 and stayed in Hidden even
with a present, valid preview file. Also clear the primary flag from
soft-deleted files so a present file is promoted and quality recovers.
2026-05-29 02:51:31 +00:00
Michael Mayer
757fc49eb6 Folders: Add long-ASCII regression test for RemoveDuplicateMoments #5615 2026-05-26 02:38:39 +00:00
Michael Mayer
570a563748 Docs: Bump copyright year to 2026 in Go package headers 2026-05-25 14:39:38 +00:00
Michael Mayer
c8390a2e8d Config: Centralize SQL driver identifiers in pkg/dsn #5588 2026-05-17 14:47:43 +00:00
Michael Mayer
ea05645668 Cleanup: Use US English spelling in code comments 2026-05-17 13:46:24 +00:00
Michael Mayer
ba08980b95 Entity: Fix nil-DB race in async count/cover updates #5551
UpdateCountsAsync and UpdateCoversAsync now register with a shared
WaitGroup so config.CloseDb can drain in-flight goroutines via
entity.WaitForAsyncJobs before nilling the DB provider. Both
synchronous helpers also bail out cleanly when entity.Db() is nil,
and the async wrappers recover so future shutdown races log instead
of crashing the test process.
2026-05-03 10:49:28 +00:00
Michael Mayer
f2aabb9bcd Security: Add gosec fixes with shared URL and fs validation helpers
Signed-off-by: Michael Mayer <michael@photoprism.app>
2026-03-03 16:38:41 +01:00
Michael Mayer
0e91ef5ba2 Index: Expanded folder-album reconciliation scope when needed #5437
Signed-off-by: Michael Mayer <michael@photoprism.app>
2026-02-24 12:15:58 +01:00
Michael Mayer
a2b7615c93 Go: Apply go fix modernizations across backend packages
Run `go fix ./...` and keep mechanical modernization updates.

- Replace `interface{}` with `any` in signatures and local types
- Apply formatter/style cleanups from go1.26 tooling
- Keep `omitempty` behavior-preserving simplifications suggested by fix
- No functional feature changes intended

Validation:
- go test ./... -run '^$' -count=1 (Go 1.26.0)
- GOTOOLCHAIN=go1.24.10 go test ./... -run '^$' -count=1

Signed-off-by: Michael Mayer <michael@photoprism.app>
2026-02-20 03:54:33 +01:00
Michael Mayer
f07f46fec8 Backend: Clean up error handling and unit tests in internal/ packages
Signed-off-by: Michael Mayer <michael@photoprism.app>
2026-02-09 12:00:33 +01:00
Michael Mayer
dc19035d8f Metrics: Add file system and account usage info #5355
Signed-off-by: Michael Mayer <michael@photoprism.app>
2025-11-30 10:43:58 +01:00
Michael Mayer
7fbc0897c3 CI: Apply Go linter recommendations to entity.ManuallyAddedFaces() #5330
Signed-off-by: Michael Mayer <michael@photoprism.app>
2025-11-23 08:51:31 +01:00
Michael Mayer
d023139c12 TestMain: Handle "defer" before os.Exit #5330
Signed-off-by: Michael Mayer <michael@photoprism.app>
2025-11-21 18:58:36 +01:00
Ömer Duran
1e00d1f52e
UX: Add batch edit dialog and API endpoints #271 #5324
Signed-off-by: Michael Mayer <michael@photoprism.app>
Co-authored-by: Michael Mayer <michael@photoprism.app>
Co-authored-by: graciousgrey <theresagresch@gmail.com>
2025-11-19 11:20:34 +01:00
Michael Mayer
c5d17c579c Albums: Improve performance when setting/refreshing cover images #5253
Signed-off-by: Michael Mayer <michael@photoprism.app>
2025-10-10 17:51:55 +02:00
Michael Mayer
68e1ddcc89 AI: Improve conflict resolution when merging face clusters #5167
Signed-off-by: Michael Mayer <michael@photoprism.app>
2025-10-07 18:58:21 +02:00
Michael Mayer
3502251f7e AI: Improve logging of face cluster merge conflicts #5167
Signed-off-by: Michael Mayer <michael@photoprism.app>
2025-10-07 17:52:02 +02:00
Michael Mayer
dcb3dd6f18 Faces: Optimized midpoint computation and performance #4669 #5167
Signed-off-by: Michael Mayer <michael@photoprism.app>
2025-10-02 19:21:29 +02:00
Michael Mayer
94b6631b3d Test: Use PascalCase names for all Go subtests in /internal
Signed-off-by: Michael Mayer <michael@photoprism.app>
2025-10-02 14:50:02 +02:00
Michael Mayer
6d551c5939 Query: Add code comments for easier troubleshooting #5235
Signed-off-by: Michael Mayer <michael@photoprism.app>
2025-09-30 21:46:42 +02:00
Michael Mayer
f49328345e Index: Fix in-memory Files/Photos lookup tables #5235
Signed-off-by: Michael Mayer <michael@photoprism.app>
2025-09-30 21:30:21 +02:00
Michael Mayer
ee46794509 CLI: Add "photoprism vision reset" command to reset metadata #5233
Signed-off-by: Michael Mayer <michael@photoprism.app>
2025-09-29 18:59:52 +02:00
Michael Mayer
bae8ceb3a7 Auth: Support asymmetric JSON Web Tokens (JWT) and Key Sets (JWKS) #5230
Signed-off-by: Michael Mayer <michael@photoprism.app>
2025-09-25 17:52:44 +02:00
Michael Mayer
61ced7119c Auth: Refactor cluster configuration and provisioning API endpoints #98
Signed-off-by: Michael Mayer <michael@photoprism.app>
2025-09-24 08:28:38 +02:00
Michael Mayer
c05fe19ba9 AI: Default to the 720x720 fit thumb for generating captions #3438 #5011
These changes also auto assign labels based on the generated captions.

Signed-off-by: Michael Mayer <michael@photoprism.app>
2025-07-16 14:58:44 +02:00
Michael Mayer
88126e3e48 Search: Add "reverse" query param to sort results in reverse order #683
Signed-off-by: Michael Mayer <michael@photoprism.app>
2025-07-14 18:08:05 +02:00
Keith Martin
22e865c66a
SQLite: Fix "too many SQL variables" error when flagging pictures as hidden #3742 #5074
* Backend: Refactor update statement to resolve too many sql variables (retro fit from gorm2)
* Backend: Refactor subquery to gorm1 compliance
2025-06-27 12:28:50 +02:00
graciousgrey
b61f3063d9 Tests: Add unit tests #4973 2025-05-02 18:39:40 +02:00
Michael Mayer
c6176d0b1e UX: Update counters and covers in the background #4323
Signed-off-by: Michael Mayer <michael@photoprism.app>
2025-03-28 23:20:28 +01:00
Jacob D
0d487b6490
Faces: Improve performance when manual tagging (#4691)
This PR implements a strategy to improve Optimize() performance by returning the correct number of modified rows in PurgeOrphanFaces and treating the result 0 as an error condition in MergeFaces. Logging around this has been improved in faces.go and faces_optimize.go.

Related Comments:
- https://github.com/photoprism/photoprism/issues/3124#issuecomment-2566025503
- https://github.com/photoprism/photoprism/pull/4691#issuecomment-2566164179
2025-03-27 01:40:31 +01:00
Michael Mayer
57060844ba Auth: Improve user model and search in backend and frontend
Signed-off-by: Michael Mayer <michael@photoprism.app>
2025-03-18 09:00:50 +01:00
Michael Mayer
6a89519e63 Videos: Refactor codec, content and file type specifications #4770
Signed-off-by: Michael Mayer <michael@photoprism.app>
2025-02-05 00:30:45 +01:00
Michael Mayer
0ada8d1095 API: Add additional fields to label and subject edit forms #383 #3168
Signed-off-by: Michael Mayer <michael@photoprism.app>
2025-01-17 02:55:07 +01:00
Michael Mayer
01f15fa406 Backend: Update copyright notices
Signed-off-by: Michael Mayer <michael@photoprism.app>
2025-01-09 10:28:17 +01:00
Michael Mayer
924ddcf2cd Index: Set labels based on matching keywords in title or subject #4602
Signed-off-by: Michael Mayer <michael@photoprism.app>
2024-11-01 12:15:39 +01:00
graciousgrey
689622dc7e Tests: Refactor unit tests after uid change #4560 2024-10-21 13:16:06 +02:00
Michael Mayer
e561b222c5 Tests: Set MediaType in internal/entity/file_fixtures.go #47 #4560
No media type was specified for some file test fixtures, which caused
tests to fail when upgrading the GORM ORM library from v1 to v2.

Signed-off-by: Michael Mayer <michael@photoprism.app>
2024-10-21 09:59:59 +02:00
graciousgrey
a2d6191b13 Tests: Add unit tests #4570 2024-10-15 14:21:44 +02:00
Michael Mayer
51bc0f1f5a CLI: Add command flag to show deleted user accounts #4570
Signed-off-by: Michael Mayer <michael@photoprism.app>
2024-10-11 11:37:11 +02:00
Michael Mayer
0c1fdd622e Config: Improve the naming of file and directory variables
Signed-off-by: Michael Mayer <michael@photoprism.app>
2024-09-13 12:30:21 +02:00
Michael Mayer
1e3f9f7984 Query: Fix session id length check in sessions.go #4490
Signed-off-by: Michael Mayer <michael@photoprism.app>
2024-08-29 10:44:32 +02:00
graciousgrey
6af5303139 Tests: Add fixtures 2024-07-16 17:28:19 +02:00