Fix/remove koreader-sync credentials from server config (#1758)

* Remove koreader-sync credentials from config

These are supposed to be set via the login/logout mutations and are not meant to be set manually by the user. Thus, they are not really settings and do not belong to the config

* Reduce log levels of KoreaderSyncService
This commit is contained in:
schroda
2025-11-01 19:31:07 +01:00
committed by GitHub
parent 53c4659044
commit 4dbd9d70d2
5 changed files with 100 additions and 47 deletions

View File

@@ -8,8 +8,8 @@ import suwayomi.tachidesk.graphql.asDataFetcherResult
import suwayomi.tachidesk.graphql.directives.RequireAuth
import suwayomi.tachidesk.graphql.types.ChapterType
import suwayomi.tachidesk.graphql.types.KoSyncConnectPayload
import suwayomi.tachidesk.graphql.types.KoSyncStatusPayload
import suwayomi.tachidesk.graphql.types.LogoutKoSyncAccountPayload
import suwayomi.tachidesk.graphql.types.SettingsType
import suwayomi.tachidesk.graphql.types.SyncConflictInfoType
import suwayomi.tachidesk.manga.impl.sync.KoreaderSyncService
import suwayomi.tachidesk.manga.model.table.ChapterTable
@@ -26,14 +26,12 @@ class KoreaderSyncMutation {
@RequireAuth
fun connectKoSyncAccount(input: ConnectKoSyncAccountInput): CompletableFuture<KoSyncConnectPayload> =
future {
val result = KoreaderSyncService.connect(input.username, input.password)
val (message, status) = KoreaderSyncService.connect(input.username, input.password)
KoSyncConnectPayload(
clientMutationId = input.clientMutationId,
success = result.success,
message = result.message,
username = result.username,
settings = SettingsType(),
message = message,
status = status,
)
}
@@ -47,8 +45,7 @@ class KoreaderSyncMutation {
KoreaderSyncService.logout()
LogoutKoSyncAccountPayload(
clientMutationId = input.clientMutationId,
success = true,
settings = SettingsType(),
status = KoSyncStatusPayload(isLoggedIn = false, username = null),
)
}

View File

@@ -7,14 +7,11 @@ data class KoSyncStatusPayload(
data class KoSyncConnectPayload(
val clientMutationId: String?,
val success: Boolean,
val status: KoSyncStatusPayload,
val message: String?,
val username: String?,
val settings: SettingsType,
)
data class LogoutKoSyncAccountPayload(
val clientMutationId: String?,
val success: Boolean,
val settings: SettingsType,
val status: KoSyncStatusPayload,
)