photoprism/internal/form/search_lenses.go
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

33 lines
952 B
Go

package form
// SearchLenses represents search form fields for command or "/api/v1/lens" (future).
type SearchLenses struct {
Query string `form:"q"`
ID string `form:"id"`
Slug string `form:"slug"`
Name string `form:"name"`
NoMake bool `form:"nomake"`
Count int `form:"count" binding:"required" serialize:"-"`
Offset int `form:"offset" serialize:"-"`
Reverse bool `form:"reverse" serialize:"-"`
}
// GetQuery returns the current search query string.
func (f *SearchLenses) GetQuery() string {
return f.Query
}
// SetQuery stores the raw query string.
func (f *SearchLenses) SetQuery(q string) {
f.Query = q
}
// ParseQueryString deserializes the query string into form fields.
func (f *SearchLenses) ParseQueryString() error {
return ParseQueryString(f)
}
// NewLensSearch creates a SearchLens form with the provided query.
func NewLensSearch(query string) SearchLenses {
return SearchLenses{Query: query}
}