consts

package
v0.52.0 Latest Latest
Warning

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

Go to latest
Published: Apr 27, 2024 License: GPL-3.0 Imports: 7 Imported by: 1

Documentation

Index

Constants

View Source
const (
	AppName = "navidrome"

	DefaultDbPath       = "navidrome.db?cache=shared&_busy_timeout=15000&_journal_mode=WAL&_foreign_keys=on"
	InitialSetupFlagKey = "InitialSetup"

	UIAuthorizationHeader  = "X-ND-Authorization"
	UIClientUniqueIDHeader = "X-ND-Client-Unique-Id"
	JWTSecretKey           = "JWTSecret"
	JWTIssuer              = "ND"
	DefaultSessionTimeout  = 24 * time.Hour
	CookieExpiry           = 365 * 24 * 3600 // One year

	// DefaultEncryptionKey This is the encryption key used if none is specified in the `PasswordEncryptionKey` option
	// Never ever change this! Or it will break all Navidrome installations that don't set the config option
	DefaultEncryptionKey  = "just for obfuscation"
	PasswordsEncryptedKey = "PasswordsEncryptedKey"
	PasswordAutogenPrefix = "__NAVIDROME_AUTOGEN__" //nolint:gosec

	DevInitialUserName = "admin"
	DevInitialName     = "Dev Admin"

	URLPathUI           = "/app"
	URLPathNativeAPI    = "/api"
	URLPathSubsonicAPI  = "/rest"
	URLPathPublic       = "/share"
	URLPathPublicImages = URLPathPublic + "/img"

	// DefaultUILoginBackgroundURL uses Navidrome curated background images collection,
	// available at https://unsplash.com/collections/20072696/navidrome
	DefaultUILoginBackgroundURL = "/backgrounds"

	// DefaultUILoginBackgroundOffline Background image used in case external integrations are disabled
	DefaultUILoginBackgroundOffline    = "" /* 828-byte string literal not displayed */
	DefaultUILoginBackgroundURLOffline = "data:image/png;base64," + DefaultUILoginBackgroundOffline
	DefaultMaxSidebarPlaylists         = 100

	RequestThrottleBacklogLimit   = 100
	RequestThrottleBacklogTimeout = time.Minute

	ServerReadHeaderTimeout = 3 * time.Second

	ArtistInfoTimeToLive = 24 * time.Hour
	AlbumInfoTimeToLive  = 7 * 24 * time.Hour

	I18nFolder   = "i18n"
	SkipScanFile = ".ndignore"

	PlaceholderArtistArt = "artist-placeholder.webp"
	PlaceholderAlbumArt  = "placeholder.png"
	PlaceholderAvatar    = "logo-192x192.png"
	UICoverArtSize       = 300
	DefaultUIVolume      = 100

	DefaultHttpClientTimeOut = 10 * time.Second

	DefaultScannerExtractor = "taglib"

	Zwsp = string('\u200b')
)
View Source
const (
	TranscodingCacheDir             = "transcoding"
	DefaultTranscodingCacheMaxItems = 0 // Unlimited

	ImageCacheDir             = "images"
	DefaultImageCacheMaxItems = 0 // Unlimited

	DefaultCacheSize            = 100 * 1024 * 1024 // 100MB
	DefaultCacheCleanUpInterval = 10 * time.Minute
)

Cache options

View Source
const (
	AlbumPlayCountModeAbsolute   = "absolute"
	AlbumPlayCountModeNormalized = "normalized"
)

Variables

View Source
var (
	DefaultDownsamplingFormat = "opus"
	DefaultTranscodings       = []map[string]interface{}{
		{
			"name":           "mp3 audio",
			"targetFormat":   "mp3",
			"defaultBitRate": 192,
			"command":        "ffmpeg -i %s -ss %t -map 0:a:0 -b:a %bk -v 0 -f mp3 -",
		},
		{
			"name":           "opus audio",
			"targetFormat":   "opus",
			"defaultBitRate": 128,
			"command":        "ffmpeg -i %s -ss %t -map 0:a:0 -b:a %bk -v 0 -c:a libopus -f opus -",
		},
		{
			"name":           "aac audio",
			"targetFormat":   "aac",
			"defaultBitRate": 256,
			"command":        "ffmpeg -i %s -ss %t -map 0:a:0 -b:a %bk -v 0 -c:a aac -f adts -",
		},
	}

	DefaultPlaylistsPath = strings.Join([]string{".", "**/**"}, string(filepath.ListSeparator))
)
View Source
var (
	VariousArtists      = "Various Artists"
	VariousArtistsID    = fmt.Sprintf("%x", md5.Sum([]byte(strings.ToLower(VariousArtists))))
	UnknownAlbum        = "[Unknown Album]"
	UnknownArtist       = "[Unknown Artist]"
	UnknownArtistID     = fmt.Sprintf("%x", md5.Sum([]byte(strings.ToLower(UnknownArtist))))
	VariousArtistsMbzId = "89ad4ac3-39f7-470e-963a-56509c546377"

	ServerStart = time.Now()
)
View Source
var LosslessFormats []string
View Source
var Version = func() string {
	if gitSha == "" {
		return "dev"
	}
	gitTag = strings.TrimPrefix(gitTag, "v")
	return fmt.Sprintf("%s (%s)", gitTag, gitSha)
}()

Version holds the version string, with tag and git sha info. Examples: dev v0.2.0 (5b84188) v0.3.2-SNAPSHOT (715f552) master (9ed35cb)

Functions

This section is empty.

Types

This section is empty.

Jump to

Keyboard shortcuts

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