convert EditTextPreference to json successfully
This commit is contained in:
@@ -58,7 +58,12 @@ object Source {
|
||||
|
||||
private val context by DI.global.instance<CustomContext>()
|
||||
|
||||
fun getSourcePreferences(sourceId: Long) {
|
||||
data class PreferenceObject(
|
||||
val type: String,
|
||||
val props: Any
|
||||
)
|
||||
|
||||
fun getSourcePreferences(sourceId: Long): List<PreferenceObject> {
|
||||
val source = getHttpSource(sourceId)
|
||||
|
||||
if (source is ConfigurableSource) {
|
||||
@@ -66,7 +71,10 @@ object Source {
|
||||
|
||||
source.setupPreferenceScreen(screen)
|
||||
|
||||
screen.preferences.forEach { println(it) }
|
||||
return screen.preferences.map {
|
||||
PreferenceObject(it::class.java.name, it)
|
||||
}
|
||||
}
|
||||
return emptyList()
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,5 +1,12 @@
|
||||
package suwayomi.tachidesk.server
|
||||
|
||||
/*
|
||||
* Copyright (C) Contributors to the Suwayomi project
|
||||
*
|
||||
* This Source Code Form is subject to the terms of the Mozilla Public
|
||||
* License, v. 2.0. If a copy of the MPL was not distributed with this
|
||||
* file, You can obtain one at https://mozilla.org/MPL/2.0/. */
|
||||
|
||||
import io.javalin.Javalin
|
||||
import kotlinx.coroutines.CoroutineScope
|
||||
import kotlinx.coroutines.Dispatchers
|
||||
@@ -13,13 +20,6 @@ import java.io.IOException
|
||||
import java.util.concurrent.CompletableFuture
|
||||
import kotlin.concurrent.thread
|
||||
|
||||
/*
|
||||
* Copyright (C) Contributors to the Suwayomi project
|
||||
*
|
||||
* This Source Code Form is subject to the terms of the Mozilla Public
|
||||
* License, v. 2.0. If a copy of the MPL was not distributed with this
|
||||
* file, You can obtain one at https://mozilla.org/MPL/2.0/. */
|
||||
|
||||
object JavalinSetup {
|
||||
private val logger = KotlinLogging.logger {}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user