2020-01-20 11:17:43 -09:00
|
|
|
package consts
|
|
|
|
|
|
2020-03-22 17:38:59 -08:00
|
|
|
import (
|
2020-03-26 05:08:53 -08:00
|
|
|
"crypto/md5"
|
|
|
|
|
"fmt"
|
|
|
|
|
"strings"
|
2020-03-22 17:38:59 -08:00
|
|
|
"time"
|
|
|
|
|
)
|
2020-01-20 11:17:43 -09:00
|
|
|
|
|
|
|
|
const (
|
2020-01-30 10:43:24 -09:00
|
|
|
AppName = "navidrome"
|
|
|
|
|
|
2020-06-08 13:29:09 -08:00
|
|
|
DefaultDbPath = "navidrome.db?cache=shared&_busy_timeout=15000&_journal_mode=WAL&_foreign_keys=on"
|
2020-01-21 05:27:38 -09:00
|
|
|
InitialSetupFlagKey = "InitialSetup"
|
2020-01-20 11:17:43 -09:00
|
|
|
|
2020-04-06 12:03:20 -08:00
|
|
|
UIAuthorizationHeader = "X-ND-Authorization"
|
2020-03-18 16:16:18 -08:00
|
|
|
JWTSecretKey = "JWTSecret"
|
|
|
|
|
JWTIssuer = "ND"
|
2020-07-03 18:08:32 -08:00
|
|
|
DefaultSessionTimeout = 24 * time.Hour
|
2020-01-20 11:17:43 -09:00
|
|
|
|
2020-02-08 10:50:33 -09:00
|
|
|
DevInitialUserName = "admin"
|
|
|
|
|
DevInitialName = "Dev Admin"
|
2020-04-03 13:50:42 -08:00
|
|
|
|
|
|
|
|
URLPathUI = "/app"
|
|
|
|
|
URLPathSubsonicAPI = "/rest"
|
2020-04-20 07:05:28 -08:00
|
|
|
|
|
|
|
|
RequestThrottleBacklogLimit = 100
|
|
|
|
|
RequestThrottleBacklogTimeout = time.Minute
|
2020-05-04 15:54:10 -08:00
|
|
|
|
2020-10-30 12:08:43 -08:00
|
|
|
ArtistInfoTimeToLive = 1 * time.Hour
|
|
|
|
|
|
2020-05-18 10:37:01 -08:00
|
|
|
I18nFolder = "i18n"
|
|
|
|
|
SkipScanFile = ".ndignore"
|
2020-06-03 05:40:37 -08:00
|
|
|
|
|
|
|
|
PlaceholderAlbumArt = "navidrome-600x600.png"
|
2020-10-23 17:37:53 -08:00
|
|
|
PlaceholderAvatar = "logo-192x192.png"
|
2020-01-20 11:17:43 -09:00
|
|
|
)
|
2020-02-29 16:01:09 -09:00
|
|
|
|
2020-04-09 09:15:01 -08:00
|
|
|
// Cache options
|
|
|
|
|
const (
|
|
|
|
|
TranscodingCacheDir = "cache/transcoding"
|
|
|
|
|
DefaultTranscodingCacheMaxItems = 0 // Unlimited
|
|
|
|
|
|
|
|
|
|
ImageCacheDir = "cache/images"
|
|
|
|
|
DefaultImageCacheMaxItems = 0 // Unlimited
|
|
|
|
|
|
|
|
|
|
DefaultCacheSize = 100 * 1024 * 1024 // 100MB
|
|
|
|
|
DefaultCacheCleanUpInterval = 10 * time.Minute
|
|
|
|
|
)
|
|
|
|
|
|
2020-02-29 16:01:09 -09:00
|
|
|
var (
|
|
|
|
|
DefaultTranscodings = []map[string]interface{}{
|
|
|
|
|
{
|
|
|
|
|
"name": "mp3 audio",
|
|
|
|
|
"targetFormat": "mp3",
|
|
|
|
|
"defaultBitRate": 192,
|
2020-04-02 20:26:41 -08:00
|
|
|
"command": "ffmpeg -i %s -map 0:0 -b:a %bk -v 0 -f mp3 -",
|
2020-02-29 16:01:09 -09:00
|
|
|
},
|
|
|
|
|
{
|
|
|
|
|
"name": "opus audio",
|
2020-09-24 08:27:13 -08:00
|
|
|
"targetFormat": "opus",
|
2020-02-29 16:01:09 -09:00
|
|
|
"defaultBitRate": 128,
|
|
|
|
|
"command": "ffmpeg -i %s -map 0:0 -b:a %bk -v 0 -c:a libopus -f opus -",
|
|
|
|
|
},
|
|
|
|
|
}
|
|
|
|
|
)
|
2020-03-22 17:38:59 -08:00
|
|
|
|
2020-03-26 05:08:53 -08:00
|
|
|
var (
|
|
|
|
|
VariousArtists = "Various Artists"
|
|
|
|
|
VariousArtistsID = fmt.Sprintf("%x", md5.Sum([]byte(strings.ToLower(VariousArtists))))
|
|
|
|
|
UnknownArtist = "[Unknown Artist]"
|
2020-03-22 17:38:59 -08:00
|
|
|
)
|