mirror of
https://github.com/advplyr/audiobookshelf.git
synced 2025-07-09 17:04:58 +02:00
This commit is contained in:
parent
f752c19418
commit
e80ec10e8a
32 changed files with 954 additions and 74 deletions
|
@ -5,14 +5,28 @@ class ServerSettings {
|
|||
constructor(settings) {
|
||||
this.id = 'server-settings'
|
||||
|
||||
// Misc/Unused
|
||||
this.autoTagNew = false
|
||||
this.newTagExpireDays = 15
|
||||
|
||||
// Scanner
|
||||
this.scannerParseSubtitle = false
|
||||
this.scannerFindCovers = false
|
||||
|
||||
// Metadata
|
||||
this.coverDestination = CoverDestination.METADATA
|
||||
this.saveMetadataFile = false
|
||||
|
||||
// Security/Rate limits
|
||||
this.rateLimitLoginRequests = 10
|
||||
this.rateLimitLoginWindow = 10 * 60 * 1000 // 10 Minutes
|
||||
|
||||
// Backups
|
||||
// this.backupSchedule = '0 1 * * *' // If false then auto-backups are disabled (default every day at 1am)
|
||||
this.backupSchedule = false
|
||||
this.backupsToKeep = 2
|
||||
this.backupMetadataCovers = true
|
||||
|
||||
this.logLevel = Logger.logLevel
|
||||
|
||||
if (settings) {
|
||||
|
@ -29,6 +43,11 @@ class ServerSettings {
|
|||
this.saveMetadataFile = !!settings.saveMetadataFile
|
||||
this.rateLimitLoginRequests = !isNaN(settings.rateLimitLoginRequests) ? Number(settings.rateLimitLoginRequests) : 10
|
||||
this.rateLimitLoginWindow = !isNaN(settings.rateLimitLoginWindow) ? Number(settings.rateLimitLoginWindow) : 10 * 60 * 1000 // 10 Minutes
|
||||
|
||||
this.backupSchedule = settings.backupSchedule || false
|
||||
this.backupsToKeep = settings.backupsToKeep || 2
|
||||
this.backupMetadataCovers = settings.backupMetadataCovers !== false
|
||||
|
||||
this.logLevel = settings.logLevel || Logger.logLevel
|
||||
|
||||
if (this.logLevel !== Logger.logLevel) {
|
||||
|
@ -47,6 +66,9 @@ class ServerSettings {
|
|||
saveMetadataFile: !!this.saveMetadataFile,
|
||||
rateLimitLoginRequests: this.rateLimitLoginRequests,
|
||||
rateLimitLoginWindow: this.rateLimitLoginWindow,
|
||||
backupSchedule: this.backupSchedule,
|
||||
backupsToKeep: this.backupsToKeep,
|
||||
backupMetadataCovers: this.backupMetadataCovers,
|
||||
logLevel: this.logLevel
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue