Documentation ¶
Overview ¶
Package customize provides user settings to customize the app.
Copyright (c) 2018 - 2024 PhotoPrism UG. All rights reserved.
This program is free software: you can redistribute it and/or modify it under Version 3 of the GNU Affero General Public License (the "AGPL"): <https://docs.photoprism.app/license/agpl> This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Affero General Public License for more details. The AGPL is supplemented by our Trademark and Brand Guidelines, which describe how our Brand Assets may be used: <https://www.photoprism.app/trademark>
Feel free to send an email to hello@photoprism.app if you have questions, want to support our work, or just want to say hello.
Additional information can be found in our Developer Guide: <https://docs.photoprism.app/developer-guide/>
Index ¶
- Constants
- Variables
- type DownloadName
- type DownloadSettings
- type FeatureSettings
- type ImportSettings
- type IndexSettings
- type MapsSettings
- type SearchSettings
- type Settings
- func (s *Settings) ApplyACL(list acl.ACL, role acl.Role) *Settings
- func (s *Settings) ApplyScope(scope string) *Settings
- func (s *Settings) Load(fileName string) error
- func (s *Settings) Propagate()
- func (s *Settings) Save(fileName string) error
- func (s Settings) StackMeta() bool
- func (s Settings) StackSequences() bool
- func (s Settings) StackUUID() bool
- type ShareSettings
- type StackSettings
- type TemplateSettings
- type UISettings
Constants ¶
const (
RootPath = "/"
)
Variables ¶
var DefaultLocale = i18n.Default.Locale()
var DefaultTheme = "default"
var DownloadNameDefault = DownloadNameFile
Functions ¶
This section is empty.
Types ¶
type DownloadName ¶
type DownloadName string
const ( DownloadNameFile DownloadName = "file" DownloadNameOriginal DownloadName = "original" )
type DownloadSettings ¶
type DownloadSettings struct { Name DownloadName `json:"name" yaml:"Name"` Disabled bool `json:"disabled" yaml:"Disabled"` Originals bool `json:"originals" yaml:"Originals"` MediaRaw bool `json:"mediaRaw" yaml:"MediaRaw"` MediaSidecar bool `json:"mediaSidecar" yaml:"MediaSidecar"` }
DownloadSettings represents content download settings.
func NewDownloadSettings ¶
func NewDownloadSettings() DownloadSettings
NewDownloadSettings creates download settings with defaults.
type FeatureSettings ¶
type FeatureSettings struct { Account bool `json:"account" yaml:"Account"` Albums bool `json:"albums" yaml:"Albums"` Archive bool `json:"archive" yaml:"Archive"` Delete bool `json:"delete" yaml:"Delete"` Download bool `json:"download" yaml:"Download"` Edit bool `json:"edit" yaml:"Edit"` Estimates bool `json:"estimates" yaml:"Estimates"` Favorites bool `json:"favorites" yaml:"Favorites"` Files bool `json:"files" yaml:"Files"` Folders bool `json:"folders" yaml:"Folders"` Import bool `json:"import" yaml:"Import"` Labels bool `json:"labels" yaml:"Labels"` Library bool `json:"library" yaml:"Library"` Logs bool `json:"logs" yaml:"Logs"` Moments bool `json:"moments" yaml:"Moments"` People bool `json:"people" yaml:"People"` Places bool `json:"places" yaml:"Places"` Private bool `json:"private" yaml:"Private"` Ratings bool `json:"ratings" yaml:"Ratings"` Reactions bool `json:"reactions" yaml:"Reactions"` Review bool `json:"review" yaml:"Review"` Search bool `json:"search" yaml:"Search"` Services bool `json:"services" yaml:"Services"` Settings bool `json:"settings" yaml:"Settings"` Upload bool `json:"upload" yaml:"Upload"` Videos bool `json:"videos" yaml:"Videos"` }
FeatureSettings represents feature flags, mainly for the Web UI.
type ImportSettings ¶
type ImportSettings struct { Path string `json:"path" yaml:"Path"` Move bool `json:"move" yaml:"Move"` }
ImportSettings represents import settings.
type IndexSettings ¶
type IndexSettings struct { Path string `json:"path" yaml:"Path"` Convert bool `json:"convert" yaml:"Convert"` Rescan bool `json:"rescan" yaml:"Rescan"` SkipArchived bool `json:"skipArchived" yaml:"SkipArchived"` }
IndexSettings represents indexing settings.
type MapsSettings ¶
type MapsSettings struct { Animate int `json:"animate" yaml:"Animate"` Style string `json:"style" yaml:"Style"` }
MapsSettings represents maps settings (for places).
type SearchSettings ¶
type SearchSettings struct {
BatchSize int `json:"batchSize" yaml:"BatchSize"`
}
SearchSettings represents search UI preferences.
type Settings ¶
type Settings struct { UI UISettings `json:"ui" yaml:"UI"` Search SearchSettings `json:"search" yaml:"Search"` Maps MapsSettings `json:"maps" yaml:"Maps"` Features FeatureSettings `json:"features" yaml:"Features"` Import ImportSettings `json:"import" yaml:"Import"` Index IndexSettings `json:"index" yaml:"Index"` Stack StackSettings `json:"stack" yaml:"Stack"` Download DownloadSettings `json:"download" yaml:"Download"` Templates TemplateSettings `json:"templates" yaml:"Templates"` }
Settings represents user settings for Web UI, indexing, and import.
func NewDefaultSettings ¶
func NewDefaultSettings() *Settings
NewDefaultSettings creates a new default Settings instance.
func NewSettings ¶
NewSettings creates a new Settings instance.
func (*Settings) ApplyACL ¶
ApplyACL updates the current settings based on the access control list provided.
func (*Settings) ApplyScope ¶
ApplyScope updates the current settings based on the authorization scope passed.
func (*Settings) Propagate ¶
func (s *Settings) Propagate()
Propagate updates settings in other packages as needed.
func (Settings) StackMeta ¶
StackMeta checks if files should be stacked based on their place and time metadata.
func (Settings) StackSequences ¶
StackSequences checks if files should be stacked based on their file name prefix (sequential names).
type ShareSettings ¶
type ShareSettings struct {
}ShareSettings represents content sharing settings.
type StackSettings ¶
type StackSettings struct { UUID bool `json:"uuid" yaml:"UUID"` Meta bool `json:"meta" yaml:"Meta"` Name bool `json:"name" yaml:"Name"` }
StackSettings represents settings for files that belong to the same photo.
type TemplateSettings ¶
type TemplateSettings struct {
Default string `json:"default" yaml:"Default"`
}
TemplateSettings represents template settings for the UI and messaging.
type UISettings ¶
type UISettings struct { Scrollbar bool `json:"scrollbar" yaml:"Scrollbar"` Zoom bool `json:"zoom" yaml:"Zoom"` Theme string `json:"theme" yaml:"Theme"` Language string `json:"language" yaml:"Language"` TimeZone string `json:"timeZone" yaml:"TimeZone"` }
UISettings represents user interface settings.