mirror of
https://github.com/Suwayomi/TachideskJUI.git
synced 2025-12-10 06:42:05 +01:00
Add root path setting
This commit is contained in:
@@ -15,6 +15,7 @@ actual class ServerHostPreferences actual constructor(
|
||||
) {
|
||||
actual fun host(): Preference<Boolean> = preferenceStore.getBoolean("host", true)
|
||||
|
||||
// IP
|
||||
private val ip = ServerHostPreference.IP(preferenceStore)
|
||||
|
||||
fun ip(): Preference<String> = ip.preference()
|
||||
@@ -23,6 +24,11 @@ actual class ServerHostPreferences actual constructor(
|
||||
|
||||
fun port(): Preference<Int> = port.preference()
|
||||
|
||||
// Root
|
||||
private val rootPath = ServerHostPreference.RootPath(preferenceStore)
|
||||
|
||||
fun rootPath(): Preference<String> = rootPath.preference()
|
||||
|
||||
// Downloader
|
||||
private val downloadPath = ServerHostPreference.DownloadPath(preferenceStore)
|
||||
|
||||
@@ -55,6 +61,7 @@ actual class ServerHostPreferences actual constructor(
|
||||
listOf(
|
||||
ip,
|
||||
port,
|
||||
rootPath,
|
||||
downloadPath,
|
||||
backupPath,
|
||||
localSourcePath,
|
||||
|
||||
@@ -63,6 +63,15 @@ sealed class ServerHostPreference<T : Any> {
|
||||
override fun preference(): Preference<Boolean> = preferenceStore.getBoolean(propertyName, defaultValue)
|
||||
}
|
||||
|
||||
// Root
|
||||
class RootPath(
|
||||
preferenceStore: PreferenceStore,
|
||||
) : StringServerHostPreference(
|
||||
preferenceStore,
|
||||
"rootDir",
|
||||
"",
|
||||
)
|
||||
|
||||
class IP(
|
||||
preferenceStore: PreferenceStore,
|
||||
) : StringServerHostPreference(
|
||||
|
||||
Reference in New Issue
Block a user