Skip to content

Commit

Permalink
Make path to local source changeable (#626)
Browse files Browse the repository at this point in the history
  • Loading branch information
schroda authored Jul 30, 2023
1 parent f0a190e commit 5a913fd
Show file tree
Hide file tree
Showing 4 changed files with 10 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,9 @@ class ServerConfig(getConfig: () -> Config, moduleName: String = MODULE_NAME) :
var backupInterval: Int by overridableConfig
var backupTTL: Int by overridableConfig

// local source
var localSourcePath: String by overridableConfig

companion object {
fun register(getConfig: () -> Config) = ServerConfig({ getConfig().getConfig(MODULE_NAME) })
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ class ApplicationDirs(
val extensionsRoot = "$dataRoot/extensions"
val thumbnailsRoot = "$dataRoot/thumbnails"
val mangaDownloadsRoot = serverConfig.downloadsPath.ifBlank { "$dataRoot/downloads" }
val localMangaRoot = "$dataRoot/local"
val localMangaRoot = serverConfig.localSourcePath.ifBlank { "$dataRoot/local" }
val webUIRoot = "$dataRoot/webUI"
val automatedBackupRoot = serverConfig.backupPath.ifBlank { "$dataRoot/backups" }

Expand Down
3 changes: 3 additions & 0 deletions server/src/main/resources/server-reference.conf
Original file line number Diff line number Diff line change
Expand Up @@ -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.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

# local source
server.localSourcePath = ""
3 changes: 3 additions & 0 deletions server/src/test/resources/server-reference.conf
Original file line number Diff line number Diff line change
Expand Up @@ -35,3 +35,6 @@ server.backupPath = ""
server.backupTime = "00:00"
server.backupInterval = 1
server.backupTTL = 14

# local source
server.localSourcePath = ""

0 comments on commit 5a913fd

Please sign in to comment.