Feature/remove download ahead logic (#867)

* Remove download ahead logic

Unnecessary on server side, should just be done by the client

* Rename "autoDownloadAheadLimit" to "autoDownloadNewChaptersLimit"

* Deprecate the old field

* Update Stable WebUI

* Update Stable WebUI

---------

Co-authored-by: Syer10 <syer10@users.noreply.github.com>
This commit is contained in:
schroda
2024-02-17 17:23:13 +01:00
committed by GitHub
parent 9edbc7f1d7
commit 6fbd2f1079
9 changed files with 28 additions and 132 deletions

View File

@@ -7,7 +7,6 @@ import org.jetbrains.exposed.sql.transactions.transaction
import suwayomi.tachidesk.graphql.types.ChapterType
import suwayomi.tachidesk.graphql.types.DownloadStatus
import suwayomi.tachidesk.manga.impl.Chapter
import suwayomi.tachidesk.manga.impl.Manga
import suwayomi.tachidesk.manga.impl.download.DownloadManager
import suwayomi.tachidesk.manga.impl.download.model.Status
import suwayomi.tachidesk.manga.model.table.ChapterTable
@@ -269,20 +268,4 @@ class DownloadMutation {
)
}
}
data class DownloadAheadInput(
val clientMutationId: String? = null,
val mangaIds: List<Int> = emptyList(),
val latestReadChapterIds: List<Int>? = null,
)
data class DownloadAheadPayload(val clientMutationId: String?)
fun downloadAhead(input: DownloadAheadInput): DownloadAheadPayload {
val (clientMutationId, mangaIds, latestReadChapterIds) = input
Manga.downloadAhead(mangaIds, latestReadChapterIds ?: emptyList())
return DownloadAheadPayload(clientMutationId)
}
}

View File

@@ -53,7 +53,8 @@ class SettingsMutation {
updateSetting(settings.downloadsPath, serverConfig.downloadsPath)
updateSetting(settings.autoDownloadNewChapters, serverConfig.autoDownloadNewChapters)
updateSetting(settings.excludeEntryWithUnreadChapters, serverConfig.excludeEntryWithUnreadChapters)
updateSetting(settings.autoDownloadAheadLimit, serverConfig.autoDownloadAheadLimit)
updateSetting(settings.autoDownloadAheadLimit, serverConfig.autoDownloadNewChaptersLimit) // deprecated
updateSetting(settings.autoDownloadNewChaptersLimit, serverConfig.autoDownloadNewChaptersLimit)
// extension
updateSetting(settings.extensionRepos, serverConfig.extensionRepos)

View File

@@ -7,6 +7,7 @@
package suwayomi.tachidesk.graphql.types
import com.expediagroup.graphql.generator.annotations.GraphQLDeprecated
import suwayomi.tachidesk.graphql.server.primitives.Node
import suwayomi.tachidesk.server.ServerConfig
import suwayomi.tachidesk.server.serverConfig
@@ -38,7 +39,13 @@ interface Settings : Node {
val downloadsPath: String?
val autoDownloadNewChapters: Boolean?
val excludeEntryWithUnreadChapters: Boolean?
@GraphQLDeprecated(
"Replaced with autoDownloadNewChaptersLimit",
replaceWith = ReplaceWith("autoDownloadNewChaptersLimit"),
)
val autoDownloadAheadLimit: Int?
val autoDownloadNewChaptersLimit: Int?
// extension
val extensionRepos: List<String>?
@@ -99,7 +106,12 @@ data class PartialSettingsType(
override val downloadsPath: String?,
override val autoDownloadNewChapters: Boolean?,
override val excludeEntryWithUnreadChapters: Boolean?,
@GraphQLDeprecated(
"Replaced with autoDownloadNewChaptersLimit",
replaceWith = ReplaceWith("autoDownloadNewChaptersLimit"),
)
override val autoDownloadAheadLimit: Int?,
override val autoDownloadNewChaptersLimit: Int?,
// extension
override val extensionRepos: List<String>?,
// requests
@@ -152,7 +164,12 @@ class SettingsType(
override val downloadsPath: String,
override val autoDownloadNewChapters: Boolean,
override val excludeEntryWithUnreadChapters: Boolean,
@GraphQLDeprecated(
"Replaced with autoDownloadNewChaptersLimit",
replaceWith = ReplaceWith("autoDownloadNewChaptersLimit"),
)
override val autoDownloadAheadLimit: Int,
override val autoDownloadNewChaptersLimit: Int,
// extension
override val extensionRepos: List<String>,
// requests
@@ -204,7 +221,8 @@ class SettingsType(
config.downloadsPath.value,
config.autoDownloadNewChapters.value,
config.excludeEntryWithUnreadChapters.value,
config.autoDownloadAheadLimit.value,
config.autoDownloadNewChaptersLimit.value, // deprecated
config.autoDownloadNewChaptersLimit.value,
// extension
config.extensionRepos.value,
// requests