Make path to local source changeable (#626)

This commit is contained in:
schroda
2023-07-30 16:29:09 +02:00
committed by GitHub
parent f0a190e8d2
commit 5a913fdfbb
4 changed files with 10 additions and 1 deletions

View File

@@ -58,6 +58,9 @@ class ServerConfig(getConfig: () -> Config, moduleName: String = MODULE_NAME) :
var backupInterval: Int by overridableConfig var backupInterval: Int by overridableConfig
var backupTTL: Int by overridableConfig var backupTTL: Int by overridableConfig
// local source
var localSourcePath: String by overridableConfig
companion object { companion object {
fun register(getConfig: () -> Config) = ServerConfig({ getConfig().getConfig(MODULE_NAME) }) fun register(getConfig: () -> Config) = ServerConfig({ getConfig().getConfig(MODULE_NAME) })
} }

View File

@@ -47,7 +47,7 @@ class ApplicationDirs(
val extensionsRoot = "$dataRoot/extensions" val extensionsRoot = "$dataRoot/extensions"
val thumbnailsRoot = "$dataRoot/thumbnails" val thumbnailsRoot = "$dataRoot/thumbnails"
val mangaDownloadsRoot = serverConfig.downloadsPath.ifBlank { "$dataRoot/downloads" } val mangaDownloadsRoot = serverConfig.downloadsPath.ifBlank { "$dataRoot/downloads" }
val localMangaRoot = "$dataRoot/local" val localMangaRoot = serverConfig.localSourcePath.ifBlank { "$dataRoot/local" }
val webUIRoot = "$dataRoot/webUI" val webUIRoot = "$dataRoot/webUI"
val automatedBackupRoot = serverConfig.backupPath.ifBlank { "$dataRoot/backups" } val automatedBackupRoot = serverConfig.backupPath.ifBlank { "$dataRoot/backups" }

View File

@@ -42,3 +42,6 @@ server.backupPath = ""
server.backupTime = "00:00" # range: hour: 0-23, minute: 0-59 - default: "00:00" - time of day at which the automated backup should be triggered server.backupTime = "00:00" # range: hour: 0-23, minute: 0-59 - default: "00:00" - time of day at which the automated backup should be triggered
server.backupInterval = 1 # time in days - 0 to disable it - range: 1 <= n < ∞ - default: 1 day - interval in which the server will automatically create a backup server.backupInterval = 1 # time in days - 0 to disable it - range: 1 <= n < ∞ - default: 1 day - interval in which the server will automatically create a backup
server.backupTTL = 14 # time in days - 0 to disable it - range: 1 <= n < ∞ - default: 14 days - how long backup files will be kept before they will get deleted server.backupTTL = 14 # time in days - 0 to disable it - range: 1 <= n < ∞ - default: 14 days - how long backup files will be kept before they will get deleted
# local source
server.localSourcePath = ""

View File

@@ -35,3 +35,6 @@ server.backupPath = ""
server.backupTime = "00:00" server.backupTime = "00:00"
server.backupInterval = 1 server.backupInterval = 1
server.backupTTL = 14 server.backupTTL = 14
# local source
server.localSourcePath = ""