Non-Extension Index changes for 1.6

This commit is contained in:
Syer10
2026-06-15 20:11:55 -04:00
parent 934459f15f
commit ceac5f74c4
33 changed files with 954 additions and 615 deletions

View File

@@ -2,6 +2,7 @@
package suwayomi.tachidesk.graphql.mutations
import com.expediagroup.graphql.generator.annotations.GraphQLDeprecated
import kotlinx.coroutines.GlobalScope
import kotlinx.coroutines.launch
import org.jetbrains.exposed.v1.core.LikePattern
@@ -167,6 +168,7 @@ class ChapterMutation {
)
@RequireAuth
@GraphQLDeprecated("Deprecated in Tachiyomix 1.6", ReplaceWith("fetchMangaAndChapters"))
fun fetchChapters(input: FetchChaptersInput): CompletableFuture<FetchChaptersPayload?> {
val (clientMutationId, mangaId) = input

View File

@@ -2,6 +2,7 @@
package suwayomi.tachidesk.graphql.mutations
import com.expediagroup.graphql.generator.annotations.GraphQLDeprecated
import org.jetbrains.exposed.v1.core.LikePattern
import org.jetbrains.exposed.v1.core.Op
import org.jetbrains.exposed.v1.core.and
@@ -14,12 +15,16 @@ import org.jetbrains.exposed.v1.jdbc.selectAll
import org.jetbrains.exposed.v1.jdbc.transactions.transaction
import org.jetbrains.exposed.v1.jdbc.update
import suwayomi.tachidesk.graphql.directives.RequireAuth
import suwayomi.tachidesk.graphql.types.ChapterType
import suwayomi.tachidesk.graphql.types.MangaMetaType
import suwayomi.tachidesk.graphql.types.MangaType
import suwayomi.tachidesk.graphql.types.MetaInput
import suwayomi.tachidesk.manga.impl.Chapter
import suwayomi.tachidesk.manga.impl.Library
import suwayomi.tachidesk.manga.impl.Manga
import suwayomi.tachidesk.manga.impl.update.IUpdater
import suwayomi.tachidesk.manga.impl.util.source.GetCatalogueSource.getCatalogueSourceOrStub
import suwayomi.tachidesk.manga.model.table.ChapterTable
import suwayomi.tachidesk.manga.model.table.MangaMetaTable
import suwayomi.tachidesk.manga.model.table.MangaTable
import suwayomi.tachidesk.manga.model.table.toDataClass
@@ -146,6 +151,7 @@ class MangaMutation {
)
@RequireAuth
@GraphQLDeprecated("Deprecated in Tachiyomix 1.6", ReplaceWith("fetchMangaAndChapters"))
fun fetchManga(input: FetchMangaInput): CompletableFuture<FetchMangaPayload?> {
val (clientMutationId, id) = input
@@ -163,6 +169,58 @@ class MangaMutation {
}
}
data class FetchMangaAndChaptersInput(
val clientMutationId: String? = null,
val id: Int,
val fetchManga: Boolean,
val fetchChapters: Boolean,
)
data class FetchMangaAndChaptersPayload(
val clientMutationId: String?,
val manga: MangaType,
val chapters: List<ChapterType>,
)
@RequireAuth
fun fetchMangaAndChapters(input: FetchMangaAndChaptersInput): CompletableFuture<FetchMangaAndChaptersPayload?> {
val (clientMutationId, id, fetchManga, fetchChapters) = input
return future {
var mangaEntry =
transaction { MangaTable.selectAll().where { MangaTable.id eq id }.first() }
val source = getCatalogueSourceOrStub(mangaEntry[MangaTable.sourceReference])
val sMangaUpdate = Manga.fetchMangaAndChapters(
mangaEntry = mangaEntry,
source = source,
fetchDetails = fetchManga,
fetchChapters = fetchChapters
)
Manga.updateMangaDatabase(mangaEntry, source, sMangaUpdate.manga)
mangaEntry = transaction { MangaTable.selectAll().where { MangaTable.id eq id }.first() }
Chapter.updateChapterListDatabase(mangaEntry, sMangaUpdate.chapters, source)
val (manga, chapters) =
transaction {
Pair(
MangaTable.selectAll().where { MangaTable.id eq id }.first(),
ChapterTable
.selectAll()
.where { ChapterTable.manga eq id }
.orderBy(ChapterTable.sourceOrder)
.map { ChapterType(it) }
)
}
FetchMangaAndChaptersPayload(
clientMutationId = clientMutationId,
manga = MangaType(manga),
chapters = chapters,
)
}
}
data class SetMangaMetaInput(
val clientMutationId: String? = null,
val meta: MangaMetaType,