customize

package
v0.0.0-...-c8acfb9 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Apr 25, 2024 License: AGPL-3.0 Imports: 9 Imported by: 0

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

View Source
const (
	RootPath = "/"
)

Variables

View Source
var DefaultLocale = i18n.Default.Locale()
View Source
var DefaultTheme = "default"
View Source
var DownloadNameDefault = DownloadNameFile

Functions

This section is empty.

Types

type DownloadName

type DownloadName string
const (
	DownloadNameFile     DownloadName = "file"
	DownloadNameOriginal DownloadName = "original"
	DownloadNameShare    DownloadName = "share"
)

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"`
	Share     bool `json:"share" yaml:"Share"`
	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"`
	Share     ShareSettings    `json:"share" yaml:"Share"`
	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

func NewSettings(theme, lang string) *Settings

NewSettings creates a new Settings instance.

func (*Settings) ApplyACL

func (s *Settings) ApplyACL(list acl.ACL, role acl.Role) *Settings

ApplyACL updates the current settings based on the access control list provided.

func (*Settings) ApplyScope

func (s *Settings) ApplyScope(scope string) *Settings

ApplyScope updates the current settings based on the authorization scope passed.

func (*Settings) Load

func (s *Settings) Load(fileName string) error

Load user settings from file.

func (*Settings) Propagate

func (s *Settings) Propagate()

Propagate updates settings in other packages as needed.

func (*Settings) Save

func (s *Settings) Save(fileName string) error

Save user settings to a file.

func (Settings) StackMeta

func (s Settings) StackMeta() bool

StackMeta checks if files should be stacked based on their place and time metadata.

func (Settings) StackSequences

func (s Settings) StackSequences() bool

StackSequences checks if files should be stacked based on their file name prefix (sequential names).

func (Settings) StackUUID

func (s Settings) StackUUID() bool

StackUUID checks if files should be stacked based on unique image or instance id.

type ShareSettings

type ShareSettings struct {
	Title string `json:"title" yaml:"Title"`
}

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.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL