mirror of
https://github.com/Suwayomi/Suwayomi-Server.git
synced 2026-07-15 00:34:12 -05:00
Compare commits
5 Commits
934459f15f
...
renovate/m
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
3bc75d5b00 | ||
|
|
fe6dd05411 | ||
|
|
57c0a85a35 | ||
|
|
c2c927ae97 | ||
|
|
2c70700bb7 |
@@ -55,7 +55,6 @@ import dev.datlag.kcef.KCEF
|
|||||||
import dev.datlag.kcef.KCEFBrowser
|
import dev.datlag.kcef.KCEFBrowser
|
||||||
import dev.datlag.kcef.KCEFClient
|
import dev.datlag.kcef.KCEFClient
|
||||||
import kotlinx.serialization.Serializable
|
import kotlinx.serialization.Serializable
|
||||||
import kotlinx.serialization.decodeFromString
|
|
||||||
import kotlinx.serialization.json.Json
|
import kotlinx.serialization.json.Json
|
||||||
import org.cef.CefSettings
|
import org.cef.CefSettings
|
||||||
import org.cef.browser.CefBrowser
|
import org.cef.browser.CefBrowser
|
||||||
@@ -88,7 +87,6 @@ import java.io.BufferedWriter
|
|||||||
import java.io.File
|
import java.io.File
|
||||||
import java.io.IOException
|
import java.io.IOException
|
||||||
import java.util.concurrent.Executor
|
import java.util.concurrent.Executor
|
||||||
import kotlin.collections.Map
|
|
||||||
import kotlin.reflect.KClass
|
import kotlin.reflect.KClass
|
||||||
import kotlin.reflect.KFunction
|
import kotlin.reflect.KFunction
|
||||||
import kotlin.reflect.full.declaredMemberFunctions
|
import kotlin.reflect.full.declaredMemberFunctions
|
||||||
|
|||||||
@@ -7,7 +7,7 @@ okhttp = "5.3.2" # Major version is locked by Tachiyomi extensions
|
|||||||
javalin = "7.2.0"
|
javalin = "7.2.0"
|
||||||
jte = "3.2.4"
|
jte = "3.2.4"
|
||||||
jackson = "3.1.3" # jackson version locked by javalin, ref: `io.javalin.core.util.OptionalDependency`
|
jackson = "3.1.3" # jackson version locked by javalin, ref: `io.javalin.core.util.OptionalDependency`
|
||||||
exposed = "0.61.0"
|
exposed = "1.2.0"
|
||||||
dex2jar = "2.4.36"
|
dex2jar = "2.4.36"
|
||||||
polyglot = "25.0.3"
|
polyglot = "25.0.3"
|
||||||
settings = "1.3.0"
|
settings = "1.3.0"
|
||||||
@@ -68,12 +68,13 @@ exposed-core = { module = "org.jetbrains.exposed:exposed-core", version.ref = "e
|
|||||||
exposed-dao = { module = "org.jetbrains.exposed:exposed-dao", version.ref = "exposed" }
|
exposed-dao = { module = "org.jetbrains.exposed:exposed-dao", version.ref = "exposed" }
|
||||||
exposed-jdbc = { module = "org.jetbrains.exposed:exposed-jdbc", version.ref = "exposed" }
|
exposed-jdbc = { module = "org.jetbrains.exposed:exposed-jdbc", version.ref = "exposed" }
|
||||||
exposed-javatime = { module = "org.jetbrains.exposed:exposed-java-time", version.ref = "exposed" }
|
exposed-javatime = { module = "org.jetbrains.exposed:exposed-java-time", version.ref = "exposed" }
|
||||||
|
exposed-kotlintime = { module = "org.jetbrains.exposed:exposed-kotlin-datetime", version.ref = "exposed" }
|
||||||
postgres = "org.postgresql:postgresql:42.7.11"
|
postgres = "org.postgresql:postgresql:42.7.11"
|
||||||
h2 = "com.h2database:h2:1.4.200" # current database driver, can't update to h2 v2 without sql migration
|
h2 = "com.h2database:h2:2.4.240"
|
||||||
hikaricp = "com.zaxxer:HikariCP:7.0.2"
|
hikaricp = "com.zaxxer:HikariCP:7.0.2"
|
||||||
|
|
||||||
# Exposed Migrations
|
# Exposed Migrations
|
||||||
exposed-migrations = "com.github.Suwayomi:exposed-migrations:3.8.0"
|
exposed-migrations = "com.github.Suwayomi:exposed-migrations:3.10.1"
|
||||||
|
|
||||||
# Dependency Injection
|
# Dependency Injection
|
||||||
koin-core = { module = "io.insert-koin:koin-core", version.ref = "koin" }
|
koin-core = { module = "io.insert-koin:koin-core", version.ref = "koin" }
|
||||||
@@ -242,6 +243,7 @@ exposed = [
|
|||||||
"exposed-dao",
|
"exposed-dao",
|
||||||
"exposed-jdbc",
|
"exposed-jdbc",
|
||||||
"exposed-javatime",
|
"exposed-javatime",
|
||||||
|
"exposed-kotlintime",
|
||||||
]
|
]
|
||||||
systemtray = [
|
systemtray = [
|
||||||
"systemtray-core",
|
"systemtray-core",
|
||||||
|
|||||||
@@ -2,7 +2,6 @@ package suwayomi.tachidesk.server.settings.generation
|
|||||||
|
|
||||||
import suwayomi.tachidesk.server.settings.SettingsRegistry
|
import suwayomi.tachidesk.server.settings.SettingsRegistry
|
||||||
import java.io.File
|
import java.io.File
|
||||||
import kotlin.text.appendLine
|
|
||||||
|
|
||||||
object SettingsBackupServerSettingsGenerator {
|
object SettingsBackupServerSettingsGenerator {
|
||||||
fun generate(
|
fun generate(
|
||||||
|
|||||||
@@ -2,7 +2,6 @@ package suwayomi.tachidesk.server.settings.generation
|
|||||||
|
|
||||||
import suwayomi.tachidesk.server.settings.SettingsRegistry
|
import suwayomi.tachidesk.server.settings.SettingsRegistry
|
||||||
import java.io.File
|
import java.io.File
|
||||||
import kotlin.text.appendLine
|
|
||||||
|
|
||||||
object SettingsBackupSettingsHandlerGenerator {
|
object SettingsBackupSettingsHandlerGenerator {
|
||||||
fun generate(
|
fun generate(
|
||||||
|
|||||||
@@ -2,7 +2,6 @@ package suwayomi.tachidesk.server.settings.generation
|
|||||||
|
|
||||||
import suwayomi.tachidesk.server.settings.SettingsRegistry
|
import suwayomi.tachidesk.server.settings.SettingsRegistry
|
||||||
import java.io.File
|
import java.io.File
|
||||||
import kotlin.text.appendLine
|
|
||||||
|
|
||||||
object SettingsGraphqlTypeGenerator {
|
object SettingsGraphqlTypeGenerator {
|
||||||
fun generate(
|
fun generate(
|
||||||
|
|||||||
@@ -25,7 +25,7 @@ import kotlinx.coroutines.flow.drop
|
|||||||
import kotlinx.coroutines.flow.launchIn
|
import kotlinx.coroutines.flow.launchIn
|
||||||
import kotlinx.coroutines.flow.mapLatest
|
import kotlinx.coroutines.flow.mapLatest
|
||||||
import kotlinx.coroutines.flow.onEach
|
import kotlinx.coroutines.flow.onEach
|
||||||
import org.jetbrains.exposed.sql.SortOrder
|
import org.jetbrains.exposed.v1.core.SortOrder
|
||||||
import suwayomi.tachidesk.graphql.types.AuthMode
|
import suwayomi.tachidesk.graphql.types.AuthMode
|
||||||
import suwayomi.tachidesk.graphql.types.CbzMediaType
|
import suwayomi.tachidesk.graphql.types.CbzMediaType
|
||||||
import suwayomi.tachidesk.graphql.types.DatabaseType
|
import suwayomi.tachidesk.graphql.types.DatabaseType
|
||||||
@@ -56,16 +56,14 @@ import suwayomi.tachidesk.server.settings.PathSetting
|
|||||||
import suwayomi.tachidesk.server.settings.SettingGroup
|
import suwayomi.tachidesk.server.settings.SettingGroup
|
||||||
import suwayomi.tachidesk.server.settings.SettingsRegistry
|
import suwayomi.tachidesk.server.settings.SettingsRegistry
|
||||||
import suwayomi.tachidesk.server.settings.StringSetting
|
import suwayomi.tachidesk.server.settings.StringSetting
|
||||||
|
import uy.kohesive.injekt.injectLazy
|
||||||
import xyz.nulldev.ts.config.GlobalConfigManager
|
import xyz.nulldev.ts.config.GlobalConfigManager
|
||||||
import xyz.nulldev.ts.config.SystemPropertyOverridableConfigModule
|
import xyz.nulldev.ts.config.SystemPropertyOverridableConfigModule
|
||||||
import kotlin.collections.associate
|
|
||||||
import kotlin.getValue
|
|
||||||
import kotlin.time.Duration
|
import kotlin.time.Duration
|
||||||
import kotlin.time.Duration.Companion.days
|
import kotlin.time.Duration.Companion.days
|
||||||
import kotlin.time.Duration.Companion.hours
|
import kotlin.time.Duration.Companion.hours
|
||||||
import kotlin.time.Duration.Companion.minutes
|
import kotlin.time.Duration.Companion.minutes
|
||||||
import kotlin.time.Duration.Companion.seconds
|
import kotlin.time.Duration.Companion.seconds
|
||||||
import uy.kohesive.injekt.injectLazy
|
|
||||||
|
|
||||||
val mutableConfigValueScope = CoroutineScope(SupervisorJob() + Dispatchers.Default)
|
val mutableConfigValueScope = CoroutineScope(SupervisorJob() + Dispatchers.Default)
|
||||||
|
|
||||||
@@ -582,7 +580,7 @@ class ServerConfig(
|
|||||||
privacySafe = true,
|
privacySafe = true,
|
||||||
defaultValue = SortOrder.DESC,
|
defaultValue = SortOrder.DESC,
|
||||||
enumClass = SortOrder::class,
|
enumClass = SortOrder::class,
|
||||||
typeInfo = SettingsRegistry.PartialTypeInfo(imports = listOf("org.jetbrains.exposed.sql.SortOrder")),
|
typeInfo = SettingsRegistry.PartialTypeInfo(imports = listOf("org.jetbrains.exposed.v1.core.SortOrder")),
|
||||||
)
|
)
|
||||||
|
|
||||||
val authMode: MutableStateFlow<AuthMode> by EnumSetting(
|
val authMode: MutableStateFlow<AuthMode> by EnumSetting(
|
||||||
|
|||||||
@@ -2,7 +2,6 @@ package suwayomi.tachidesk.server.settings
|
|||||||
|
|
||||||
import com.typesafe.config.ConfigValue
|
import com.typesafe.config.ConfigValue
|
||||||
import com.typesafe.config.parser.ConfigDocument
|
import com.typesafe.config.parser.ConfigDocument
|
||||||
import kotlin.collections.find
|
|
||||||
import kotlin.reflect.KClass
|
import kotlin.reflect.KClass
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|||||||
@@ -2,7 +2,6 @@ package eu.kanade.tachiyomi.network
|
|||||||
|
|
||||||
import kotlinx.coroutines.suspendCancellableCoroutine
|
import kotlinx.coroutines.suspendCancellableCoroutine
|
||||||
import kotlinx.serialization.DeserializationStrategy
|
import kotlinx.serialization.DeserializationStrategy
|
||||||
import kotlinx.serialization.ExperimentalSerializationApi
|
|
||||||
import kotlinx.serialization.json.Json
|
import kotlinx.serialization.json.Json
|
||||||
import kotlinx.serialization.json.okio.decodeFromBufferedSource
|
import kotlinx.serialization.json.okio.decodeFromBufferedSource
|
||||||
import kotlinx.serialization.serializer
|
import kotlinx.serialization.serializer
|
||||||
|
|||||||
@@ -36,10 +36,11 @@ import nl.adaptivity.xmlutil.ExperimentalXmlUtilApi
|
|||||||
import nl.adaptivity.xmlutil.core.KtXmlReader
|
import nl.adaptivity.xmlutil.core.KtXmlReader
|
||||||
import nl.adaptivity.xmlutil.serialization.XML
|
import nl.adaptivity.xmlutil.serialization.XML
|
||||||
import org.apache.commons.compress.archivers.zip.ZipFile
|
import org.apache.commons.compress.archivers.zip.ZipFile
|
||||||
import org.jetbrains.exposed.sql.insert
|
import org.jetbrains.exposed.v1.core.eq
|
||||||
import org.jetbrains.exposed.sql.insertAndGetId
|
import org.jetbrains.exposed.v1.jdbc.insert
|
||||||
import org.jetbrains.exposed.sql.selectAll
|
import org.jetbrains.exposed.v1.jdbc.insertAndGetId
|
||||||
import org.jetbrains.exposed.sql.transactions.transaction
|
import org.jetbrains.exposed.v1.jdbc.selectAll
|
||||||
|
import org.jetbrains.exposed.v1.jdbc.transactions.transaction
|
||||||
import suwayomi.tachidesk.manga.impl.util.source.GetCatalogueSource.registerCatalogueSource
|
import suwayomi.tachidesk.manga.impl.util.source.GetCatalogueSource.registerCatalogueSource
|
||||||
import suwayomi.tachidesk.manga.impl.util.storage.ImageUtil
|
import suwayomi.tachidesk.manga.impl.util.storage.ImageUtil
|
||||||
import suwayomi.tachidesk.manga.model.table.ExtensionTable
|
import suwayomi.tachidesk.manga.model.table.ExtensionTable
|
||||||
|
|||||||
@@ -1,10 +1,12 @@
|
|||||||
package suwayomi.tachidesk.global.impl
|
package suwayomi.tachidesk.global.impl
|
||||||
|
|
||||||
import org.jetbrains.exposed.dao.id.EntityID
|
import org.jetbrains.exposed.v1.core.dao.id.EntityID
|
||||||
import org.jetbrains.exposed.sql.batchInsert
|
import org.jetbrains.exposed.v1.core.inList
|
||||||
import org.jetbrains.exposed.sql.selectAll
|
import org.jetbrains.exposed.v1.core.statements.BatchUpdateStatement
|
||||||
import org.jetbrains.exposed.sql.statements.BatchUpdateStatement
|
import org.jetbrains.exposed.v1.jdbc.batchInsert
|
||||||
import org.jetbrains.exposed.sql.transactions.transaction
|
import org.jetbrains.exposed.v1.jdbc.selectAll
|
||||||
|
import org.jetbrains.exposed.v1.jdbc.statements.toExecutable
|
||||||
|
import org.jetbrains.exposed.v1.jdbc.transactions.transaction
|
||||||
import suwayomi.tachidesk.global.model.table.GlobalMetaTable
|
import suwayomi.tachidesk.global.model.table.GlobalMetaTable
|
||||||
|
|
||||||
/*
|
/*
|
||||||
@@ -32,13 +34,14 @@ object GlobalMeta {
|
|||||||
val (existingMeta, newMeta) = meta.toList().partition { (key) -> key in dbMetaMap.keys }
|
val (existingMeta, newMeta) = meta.toList().partition { (key) -> key in dbMetaMap.keys }
|
||||||
|
|
||||||
if (existingMeta.isNotEmpty()) {
|
if (existingMeta.isNotEmpty()) {
|
||||||
BatchUpdateStatement(GlobalMetaTable).apply {
|
BatchUpdateStatement(GlobalMetaTable)
|
||||||
existingMeta.forEach { (key, value) ->
|
.apply {
|
||||||
addBatch(EntityID(dbMetaMap[key]!![GlobalMetaTable.id].value, GlobalMetaTable))
|
existingMeta.forEach { (key, value) ->
|
||||||
this[GlobalMetaTable.value] = value
|
addBatch(EntityID(dbMetaMap[key]!![GlobalMetaTable.id].value, GlobalMetaTable))
|
||||||
}
|
this[GlobalMetaTable.value] = value
|
||||||
execute(this@transaction)
|
}
|
||||||
}
|
}.toExecutable()
|
||||||
|
.execute(this@transaction)
|
||||||
}
|
}
|
||||||
|
|
||||||
if (newMeta.isNotEmpty()) {
|
if (newMeta.isNotEmpty()) {
|
||||||
|
|||||||
@@ -7,7 +7,7 @@ package suwayomi.tachidesk.global.model.table
|
|||||||
* License, v. 2.0. If a copy of the MPL was not distributed with this
|
* 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/. */
|
* file, You can obtain one at https://mozilla.org/MPL/2.0/. */
|
||||||
|
|
||||||
import org.jetbrains.exposed.dao.id.IntIdTable
|
import org.jetbrains.exposed.v1.core.dao.id.IntIdTable
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Metadata storage for clients, server/global level.
|
* Metadata storage for clients, server/global level.
|
||||||
|
|||||||
@@ -11,10 +11,10 @@ import com.expediagroup.graphql.dataloader.KotlinDataLoader
|
|||||||
import graphql.GraphQLContext
|
import graphql.GraphQLContext
|
||||||
import org.dataloader.DataLoader
|
import org.dataloader.DataLoader
|
||||||
import org.dataloader.DataLoaderFactory
|
import org.dataloader.DataLoaderFactory
|
||||||
import org.jetbrains.exposed.sql.Slf4jSqlDebugLogger
|
import org.jetbrains.exposed.v1.core.Slf4jSqlDebugLogger
|
||||||
import org.jetbrains.exposed.sql.addLogger
|
import org.jetbrains.exposed.v1.core.inList
|
||||||
import org.jetbrains.exposed.sql.selectAll
|
import org.jetbrains.exposed.v1.jdbc.selectAll
|
||||||
import org.jetbrains.exposed.sql.transactions.transaction
|
import org.jetbrains.exposed.v1.jdbc.transactions.transaction
|
||||||
import suwayomi.tachidesk.graphql.types.CategoryNodeList
|
import suwayomi.tachidesk.graphql.types.CategoryNodeList
|
||||||
import suwayomi.tachidesk.graphql.types.CategoryNodeList.Companion.toNodeList
|
import suwayomi.tachidesk.graphql.types.CategoryNodeList.Companion.toNodeList
|
||||||
import suwayomi.tachidesk.graphql.types.CategoryType
|
import suwayomi.tachidesk.graphql.types.CategoryType
|
||||||
|
|||||||
@@ -11,13 +11,17 @@ import com.expediagroup.graphql.dataloader.KotlinDataLoader
|
|||||||
import graphql.GraphQLContext
|
import graphql.GraphQLContext
|
||||||
import org.dataloader.DataLoader
|
import org.dataloader.DataLoader
|
||||||
import org.dataloader.DataLoaderFactory
|
import org.dataloader.DataLoaderFactory
|
||||||
import org.jetbrains.exposed.sql.Slf4jSqlDebugLogger
|
import org.jetbrains.exposed.v1.core.Slf4jSqlDebugLogger
|
||||||
import org.jetbrains.exposed.sql.SortOrder
|
import org.jetbrains.exposed.v1.core.SortOrder
|
||||||
import org.jetbrains.exposed.sql.addLogger
|
import org.jetbrains.exposed.v1.core.and
|
||||||
import org.jetbrains.exposed.sql.and
|
import org.jetbrains.exposed.v1.core.count
|
||||||
import org.jetbrains.exposed.sql.count
|
import org.jetbrains.exposed.v1.core.eq
|
||||||
import org.jetbrains.exposed.sql.selectAll
|
import org.jetbrains.exposed.v1.core.greater
|
||||||
import org.jetbrains.exposed.sql.transactions.transaction
|
import org.jetbrains.exposed.v1.core.greaterEq
|
||||||
|
import org.jetbrains.exposed.v1.core.inList
|
||||||
|
import org.jetbrains.exposed.v1.jdbc.select
|
||||||
|
import org.jetbrains.exposed.v1.jdbc.selectAll
|
||||||
|
import org.jetbrains.exposed.v1.jdbc.transactions.transaction
|
||||||
import suwayomi.tachidesk.graphql.types.ChapterNodeList
|
import suwayomi.tachidesk.graphql.types.ChapterNodeList
|
||||||
import suwayomi.tachidesk.graphql.types.ChapterNodeList.Companion.toNodeList
|
import suwayomi.tachidesk.graphql.types.ChapterNodeList.Companion.toNodeList
|
||||||
import suwayomi.tachidesk.graphql.types.ChapterType
|
import suwayomi.tachidesk.graphql.types.ChapterType
|
||||||
|
|||||||
@@ -11,10 +11,10 @@ import com.expediagroup.graphql.dataloader.KotlinDataLoader
|
|||||||
import graphql.GraphQLContext
|
import graphql.GraphQLContext
|
||||||
import org.dataloader.DataLoader
|
import org.dataloader.DataLoader
|
||||||
import org.dataloader.DataLoaderFactory
|
import org.dataloader.DataLoaderFactory
|
||||||
import org.jetbrains.exposed.sql.Slf4jSqlDebugLogger
|
import org.jetbrains.exposed.v1.core.Slf4jSqlDebugLogger
|
||||||
import org.jetbrains.exposed.sql.addLogger
|
import org.jetbrains.exposed.v1.core.inList
|
||||||
import org.jetbrains.exposed.sql.selectAll
|
import org.jetbrains.exposed.v1.jdbc.selectAll
|
||||||
import org.jetbrains.exposed.sql.transactions.transaction
|
import org.jetbrains.exposed.v1.jdbc.transactions.transaction
|
||||||
import suwayomi.tachidesk.graphql.types.ExtensionType
|
import suwayomi.tachidesk.graphql.types.ExtensionType
|
||||||
import suwayomi.tachidesk.manga.model.table.ExtensionTable
|
import suwayomi.tachidesk.manga.model.table.ExtensionTable
|
||||||
import suwayomi.tachidesk.manga.model.table.SourceTable
|
import suwayomi.tachidesk.manga.model.table.SourceTable
|
||||||
|
|||||||
@@ -12,11 +12,13 @@ import graphql.GraphQLContext
|
|||||||
import org.dataloader.DataLoader
|
import org.dataloader.DataLoader
|
||||||
import org.dataloader.DataLoaderFactory
|
import org.dataloader.DataLoaderFactory
|
||||||
import org.dataloader.DataLoaderOptions
|
import org.dataloader.DataLoaderOptions
|
||||||
import org.jetbrains.exposed.sql.Slf4jSqlDebugLogger
|
import org.jetbrains.exposed.v1.core.Slf4jSqlDebugLogger
|
||||||
import org.jetbrains.exposed.sql.addLogger
|
import org.jetbrains.exposed.v1.core.eq
|
||||||
import org.jetbrains.exposed.sql.andWhere
|
import org.jetbrains.exposed.v1.core.inList
|
||||||
import org.jetbrains.exposed.sql.selectAll
|
import org.jetbrains.exposed.v1.core.isNull
|
||||||
import org.jetbrains.exposed.sql.transactions.transaction
|
import org.jetbrains.exposed.v1.jdbc.andWhere
|
||||||
|
import org.jetbrains.exposed.v1.jdbc.selectAll
|
||||||
|
import org.jetbrains.exposed.v1.jdbc.transactions.transaction
|
||||||
import suwayomi.tachidesk.graphql.cache.CustomCacheMap
|
import suwayomi.tachidesk.graphql.cache.CustomCacheMap
|
||||||
import suwayomi.tachidesk.graphql.types.MangaNodeList
|
import suwayomi.tachidesk.graphql.types.MangaNodeList
|
||||||
import suwayomi.tachidesk.graphql.types.MangaNodeList.Companion.toNodeList
|
import suwayomi.tachidesk.graphql.types.MangaNodeList.Companion.toNodeList
|
||||||
|
|||||||
@@ -4,10 +4,10 @@ import com.expediagroup.graphql.dataloader.KotlinDataLoader
|
|||||||
import graphql.GraphQLContext
|
import graphql.GraphQLContext
|
||||||
import org.dataloader.DataLoader
|
import org.dataloader.DataLoader
|
||||||
import org.dataloader.DataLoaderFactory
|
import org.dataloader.DataLoaderFactory
|
||||||
import org.jetbrains.exposed.sql.Slf4jSqlDebugLogger
|
import org.jetbrains.exposed.v1.core.Slf4jSqlDebugLogger
|
||||||
import org.jetbrains.exposed.sql.addLogger
|
import org.jetbrains.exposed.v1.core.inList
|
||||||
import org.jetbrains.exposed.sql.selectAll
|
import org.jetbrains.exposed.v1.jdbc.selectAll
|
||||||
import org.jetbrains.exposed.sql.transactions.transaction
|
import org.jetbrains.exposed.v1.jdbc.transactions.transaction
|
||||||
import suwayomi.tachidesk.global.model.table.GlobalMetaTable
|
import suwayomi.tachidesk.global.model.table.GlobalMetaTable
|
||||||
import suwayomi.tachidesk.graphql.types.CategoryMetaType
|
import suwayomi.tachidesk.graphql.types.CategoryMetaType
|
||||||
import suwayomi.tachidesk.graphql.types.ChapterMetaType
|
import suwayomi.tachidesk.graphql.types.ChapterMetaType
|
||||||
|
|||||||
@@ -11,10 +11,10 @@ import com.expediagroup.graphql.dataloader.KotlinDataLoader
|
|||||||
import graphql.GraphQLContext
|
import graphql.GraphQLContext
|
||||||
import org.dataloader.DataLoader
|
import org.dataloader.DataLoader
|
||||||
import org.dataloader.DataLoaderFactory
|
import org.dataloader.DataLoaderFactory
|
||||||
import org.jetbrains.exposed.sql.Slf4jSqlDebugLogger
|
import org.jetbrains.exposed.v1.core.Slf4jSqlDebugLogger
|
||||||
import org.jetbrains.exposed.sql.addLogger
|
import org.jetbrains.exposed.v1.core.inList
|
||||||
import org.jetbrains.exposed.sql.selectAll
|
import org.jetbrains.exposed.v1.jdbc.selectAll
|
||||||
import org.jetbrains.exposed.sql.transactions.transaction
|
import org.jetbrains.exposed.v1.jdbc.transactions.transaction
|
||||||
import suwayomi.tachidesk.graphql.types.SourceNodeList
|
import suwayomi.tachidesk.graphql.types.SourceNodeList
|
||||||
import suwayomi.tachidesk.graphql.types.SourceNodeList.Companion.toNodeList
|
import suwayomi.tachidesk.graphql.types.SourceNodeList.Companion.toNodeList
|
||||||
import suwayomi.tachidesk.graphql.types.SourceType
|
import suwayomi.tachidesk.graphql.types.SourceType
|
||||||
|
|||||||
@@ -11,10 +11,10 @@ import com.expediagroup.graphql.dataloader.KotlinDataLoader
|
|||||||
import graphql.GraphQLContext
|
import graphql.GraphQLContext
|
||||||
import org.dataloader.DataLoader
|
import org.dataloader.DataLoader
|
||||||
import org.dataloader.DataLoaderFactory
|
import org.dataloader.DataLoaderFactory
|
||||||
import org.jetbrains.exposed.sql.Slf4jSqlDebugLogger
|
import org.jetbrains.exposed.v1.core.Slf4jSqlDebugLogger
|
||||||
import org.jetbrains.exposed.sql.addLogger
|
import org.jetbrains.exposed.v1.core.inList
|
||||||
import org.jetbrains.exposed.sql.selectAll
|
import org.jetbrains.exposed.v1.jdbc.selectAll
|
||||||
import org.jetbrains.exposed.sql.transactions.transaction
|
import org.jetbrains.exposed.v1.jdbc.transactions.transaction
|
||||||
import suwayomi.tachidesk.graphql.types.TrackRecordNodeList
|
import suwayomi.tachidesk.graphql.types.TrackRecordNodeList
|
||||||
import suwayomi.tachidesk.graphql.types.TrackRecordNodeList.Companion.toNodeList
|
import suwayomi.tachidesk.graphql.types.TrackRecordNodeList.Companion.toNodeList
|
||||||
import suwayomi.tachidesk.graphql.types.TrackRecordType
|
import suwayomi.tachidesk.graphql.types.TrackRecordType
|
||||||
|
|||||||
@@ -2,21 +2,22 @@
|
|||||||
|
|
||||||
package suwayomi.tachidesk.graphql.mutations
|
package suwayomi.tachidesk.graphql.mutations
|
||||||
|
|
||||||
import graphql.execution.DataFetcherResult
|
import org.jetbrains.exposed.v1.core.LikePattern
|
||||||
import org.jetbrains.exposed.sql.LikePattern
|
import org.jetbrains.exposed.v1.core.Op
|
||||||
import org.jetbrains.exposed.sql.Op
|
import org.jetbrains.exposed.v1.core.and
|
||||||
import org.jetbrains.exposed.sql.SqlExpressionBuilder.eq
|
import org.jetbrains.exposed.v1.core.eq
|
||||||
import org.jetbrains.exposed.sql.SqlExpressionBuilder.inList
|
import org.jetbrains.exposed.v1.core.greaterEq
|
||||||
import org.jetbrains.exposed.sql.SqlExpressionBuilder.like
|
import org.jetbrains.exposed.v1.core.inList
|
||||||
import org.jetbrains.exposed.sql.SqlExpressionBuilder.minus
|
import org.jetbrains.exposed.v1.core.lessEq
|
||||||
import org.jetbrains.exposed.sql.SqlExpressionBuilder.plus
|
import org.jetbrains.exposed.v1.core.like
|
||||||
import org.jetbrains.exposed.sql.and
|
import org.jetbrains.exposed.v1.core.minus
|
||||||
import org.jetbrains.exposed.sql.deleteWhere
|
import org.jetbrains.exposed.v1.core.or
|
||||||
import org.jetbrains.exposed.sql.insertAndGetId
|
import org.jetbrains.exposed.v1.core.plus
|
||||||
import org.jetbrains.exposed.sql.or
|
import org.jetbrains.exposed.v1.jdbc.deleteWhere
|
||||||
import org.jetbrains.exposed.sql.selectAll
|
import org.jetbrains.exposed.v1.jdbc.insertAndGetId
|
||||||
import org.jetbrains.exposed.sql.transactions.transaction
|
import org.jetbrains.exposed.v1.jdbc.selectAll
|
||||||
import org.jetbrains.exposed.sql.update
|
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.directives.RequireAuth
|
||||||
import suwayomi.tachidesk.graphql.types.CategoryMetaType
|
import suwayomi.tachidesk.graphql.types.CategoryMetaType
|
||||||
import suwayomi.tachidesk.graphql.types.CategoryType
|
import suwayomi.tachidesk.graphql.types.CategoryType
|
||||||
|
|||||||
@@ -4,19 +4,21 @@ package suwayomi.tachidesk.graphql.mutations
|
|||||||
|
|
||||||
import kotlinx.coroutines.GlobalScope
|
import kotlinx.coroutines.GlobalScope
|
||||||
import kotlinx.coroutines.launch
|
import kotlinx.coroutines.launch
|
||||||
import org.jetbrains.exposed.dao.id.EntityID
|
import org.jetbrains.exposed.v1.core.LikePattern
|
||||||
import org.jetbrains.exposed.sql.LikePattern
|
import org.jetbrains.exposed.v1.core.Op
|
||||||
import org.jetbrains.exposed.sql.Op
|
import org.jetbrains.exposed.v1.core.and
|
||||||
import org.jetbrains.exposed.sql.SqlExpressionBuilder.eq
|
import org.jetbrains.exposed.v1.core.dao.id.EntityID
|
||||||
import org.jetbrains.exposed.sql.SqlExpressionBuilder.inList
|
import org.jetbrains.exposed.v1.core.eq
|
||||||
import org.jetbrains.exposed.sql.SqlExpressionBuilder.like
|
import org.jetbrains.exposed.v1.core.inList
|
||||||
import org.jetbrains.exposed.sql.and
|
import org.jetbrains.exposed.v1.core.like
|
||||||
import org.jetbrains.exposed.sql.deleteWhere
|
import org.jetbrains.exposed.v1.core.or
|
||||||
import org.jetbrains.exposed.sql.or
|
import org.jetbrains.exposed.v1.core.statements.BatchUpdateStatement
|
||||||
import org.jetbrains.exposed.sql.selectAll
|
import org.jetbrains.exposed.v1.jdbc.deleteWhere
|
||||||
import org.jetbrains.exposed.sql.statements.BatchUpdateStatement
|
import org.jetbrains.exposed.v1.jdbc.select
|
||||||
import org.jetbrains.exposed.sql.transactions.transaction
|
import org.jetbrains.exposed.v1.jdbc.selectAll
|
||||||
import org.jetbrains.exposed.sql.update
|
import org.jetbrains.exposed.v1.jdbc.statements.toExecutable
|
||||||
|
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.directives.RequireAuth
|
||||||
import suwayomi.tachidesk.graphql.types.ChapterMetaType
|
import suwayomi.tachidesk.graphql.types.ChapterMetaType
|
||||||
import suwayomi.tachidesk.graphql.types.ChapterType
|
import suwayomi.tachidesk.graphql.types.ChapterType
|
||||||
@@ -90,22 +92,23 @@ class ChapterMutation {
|
|||||||
if (patch.isRead != null || patch.isBookmarked != null || patch.lastPageRead != null) {
|
if (patch.isRead != null || patch.isBookmarked != null || patch.lastPageRead != null) {
|
||||||
val now = Instant.now().epochSecond
|
val now = Instant.now().epochSecond
|
||||||
|
|
||||||
BatchUpdateStatement(ChapterTable).apply {
|
BatchUpdateStatement(ChapterTable)
|
||||||
ids.forEach { chapterId ->
|
.apply {
|
||||||
addBatch(EntityID(chapterId, ChapterTable))
|
ids.forEach { chapterId ->
|
||||||
patch.isRead?.also {
|
addBatch(EntityID(chapterId, ChapterTable))
|
||||||
this[ChapterTable.isRead] = it
|
patch.isRead?.also {
|
||||||
|
this[ChapterTable.isRead] = it
|
||||||
|
}
|
||||||
|
patch.isBookmarked?.also {
|
||||||
|
this[ChapterTable.isBookmarked] = it
|
||||||
|
}
|
||||||
|
patch.lastPageRead?.also {
|
||||||
|
this[ChapterTable.lastPageRead] = it.coerceAtMost(chapterIdToPageCount[chapterId] ?: 0).coerceAtLeast(0)
|
||||||
|
this[ChapterTable.lastReadAt] = now
|
||||||
|
}
|
||||||
}
|
}
|
||||||
patch.isBookmarked?.also {
|
}.toExecutable()
|
||||||
this[ChapterTable.isBookmarked] = it
|
.execute(this@transaction)
|
||||||
}
|
|
||||||
patch.lastPageRead?.also {
|
|
||||||
this[ChapterTable.lastPageRead] = it.coerceAtMost(chapterIdToPageCount[chapterId] ?: 0).coerceAtLeast(0)
|
|
||||||
this[ChapterTable.lastReadAt] = now
|
|
||||||
}
|
|
||||||
}
|
|
||||||
execute(this@transaction)
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -2,11 +2,12 @@
|
|||||||
|
|
||||||
package suwayomi.tachidesk.graphql.mutations
|
package suwayomi.tachidesk.graphql.mutations
|
||||||
|
|
||||||
import graphql.execution.DataFetcherResult
|
|
||||||
import kotlinx.coroutines.flow.first
|
import kotlinx.coroutines.flow.first
|
||||||
import kotlinx.coroutines.withTimeout
|
import kotlinx.coroutines.withTimeout
|
||||||
import org.jetbrains.exposed.sql.selectAll
|
import org.jetbrains.exposed.v1.core.eq
|
||||||
import org.jetbrains.exposed.sql.transactions.transaction
|
import org.jetbrains.exposed.v1.core.inList
|
||||||
|
import org.jetbrains.exposed.v1.jdbc.selectAll
|
||||||
|
import org.jetbrains.exposed.v1.jdbc.transactions.transaction
|
||||||
import suwayomi.tachidesk.graphql.directives.RequireAuth
|
import suwayomi.tachidesk.graphql.directives.RequireAuth
|
||||||
import suwayomi.tachidesk.graphql.types.ChapterType
|
import suwayomi.tachidesk.graphql.types.ChapterType
|
||||||
import suwayomi.tachidesk.graphql.types.DownloadStatus
|
import suwayomi.tachidesk.graphql.types.DownloadStatus
|
||||||
|
|||||||
@@ -3,10 +3,12 @@
|
|||||||
package suwayomi.tachidesk.graphql.mutations
|
package suwayomi.tachidesk.graphql.mutations
|
||||||
|
|
||||||
import eu.kanade.tachiyomi.source.local.LocalSource
|
import eu.kanade.tachiyomi.source.local.LocalSource
|
||||||
import graphql.execution.DataFetcherResult
|
|
||||||
import io.javalin.http.UploadedFile
|
import io.javalin.http.UploadedFile
|
||||||
import org.jetbrains.exposed.sql.selectAll
|
import org.jetbrains.exposed.v1.core.eq
|
||||||
import org.jetbrains.exposed.sql.transactions.transaction
|
import org.jetbrains.exposed.v1.core.inList
|
||||||
|
import org.jetbrains.exposed.v1.core.neq
|
||||||
|
import org.jetbrains.exposed.v1.jdbc.selectAll
|
||||||
|
import org.jetbrains.exposed.v1.jdbc.transactions.transaction
|
||||||
import suwayomi.tachidesk.graphql.directives.RequireAuth
|
import suwayomi.tachidesk.graphql.directives.RequireAuth
|
||||||
import suwayomi.tachidesk.graphql.types.ExtensionType
|
import suwayomi.tachidesk.graphql.types.ExtensionType
|
||||||
import suwayomi.tachidesk.manga.impl.extension.Extension
|
import suwayomi.tachidesk.manga.impl.extension.Extension
|
||||||
|
|||||||
@@ -2,7 +2,6 @@
|
|||||||
|
|
||||||
package suwayomi.tachidesk.graphql.mutations
|
package suwayomi.tachidesk.graphql.mutations
|
||||||
|
|
||||||
import graphql.execution.DataFetcherResult
|
|
||||||
import kotlinx.coroutines.flow.first
|
import kotlinx.coroutines.flow.first
|
||||||
import kotlinx.coroutines.withTimeout
|
import kotlinx.coroutines.withTimeout
|
||||||
import suwayomi.tachidesk.graphql.directives.RequireAuth
|
import suwayomi.tachidesk.graphql.directives.RequireAuth
|
||||||
|
|||||||
@@ -2,10 +2,10 @@
|
|||||||
|
|
||||||
package suwayomi.tachidesk.graphql.mutations
|
package suwayomi.tachidesk.graphql.mutations
|
||||||
|
|
||||||
import graphql.execution.DataFetcherResult
|
import org.jetbrains.exposed.v1.core.eq
|
||||||
import org.jetbrains.exposed.sql.selectAll
|
import org.jetbrains.exposed.v1.jdbc.selectAll
|
||||||
import org.jetbrains.exposed.sql.transactions.transaction
|
import org.jetbrains.exposed.v1.jdbc.transactions.transaction
|
||||||
import org.jetbrains.exposed.sql.update
|
import org.jetbrains.exposed.v1.jdbc.update
|
||||||
import suwayomi.tachidesk.graphql.directives.RequireAuth
|
import suwayomi.tachidesk.graphql.directives.RequireAuth
|
||||||
import suwayomi.tachidesk.graphql.types.ChapterType
|
import suwayomi.tachidesk.graphql.types.ChapterType
|
||||||
import suwayomi.tachidesk.graphql.types.KoSyncConnectPayload
|
import suwayomi.tachidesk.graphql.types.KoSyncConnectPayload
|
||||||
|
|||||||
@@ -2,17 +2,17 @@
|
|||||||
|
|
||||||
package suwayomi.tachidesk.graphql.mutations
|
package suwayomi.tachidesk.graphql.mutations
|
||||||
|
|
||||||
import org.jetbrains.exposed.sql.LikePattern
|
import org.jetbrains.exposed.v1.core.LikePattern
|
||||||
import org.jetbrains.exposed.sql.Op
|
import org.jetbrains.exposed.v1.core.Op
|
||||||
import org.jetbrains.exposed.sql.SqlExpressionBuilder.eq
|
import org.jetbrains.exposed.v1.core.and
|
||||||
import org.jetbrains.exposed.sql.SqlExpressionBuilder.inList
|
import org.jetbrains.exposed.v1.core.eq
|
||||||
import org.jetbrains.exposed.sql.SqlExpressionBuilder.like
|
import org.jetbrains.exposed.v1.core.inList
|
||||||
import org.jetbrains.exposed.sql.and
|
import org.jetbrains.exposed.v1.core.like
|
||||||
import org.jetbrains.exposed.sql.deleteWhere
|
import org.jetbrains.exposed.v1.core.or
|
||||||
import org.jetbrains.exposed.sql.or
|
import org.jetbrains.exposed.v1.jdbc.deleteWhere
|
||||||
import org.jetbrains.exposed.sql.selectAll
|
import org.jetbrains.exposed.v1.jdbc.selectAll
|
||||||
import org.jetbrains.exposed.sql.transactions.transaction
|
import org.jetbrains.exposed.v1.jdbc.transactions.transaction
|
||||||
import org.jetbrains.exposed.sql.update
|
import org.jetbrains.exposed.v1.jdbc.update
|
||||||
import suwayomi.tachidesk.graphql.directives.RequireAuth
|
import suwayomi.tachidesk.graphql.directives.RequireAuth
|
||||||
import suwayomi.tachidesk.graphql.types.MangaMetaType
|
import suwayomi.tachidesk.graphql.types.MangaMetaType
|
||||||
import suwayomi.tachidesk.graphql.types.MangaType
|
import suwayomi.tachidesk.graphql.types.MangaType
|
||||||
|
|||||||
@@ -2,16 +2,15 @@
|
|||||||
|
|
||||||
package suwayomi.tachidesk.graphql.mutations
|
package suwayomi.tachidesk.graphql.mutations
|
||||||
|
|
||||||
import graphql.execution.DataFetcherResult
|
import org.jetbrains.exposed.v1.core.LikePattern
|
||||||
import org.jetbrains.exposed.sql.LikePattern
|
import org.jetbrains.exposed.v1.core.Op
|
||||||
import org.jetbrains.exposed.sql.Op
|
import org.jetbrains.exposed.v1.core.eq
|
||||||
import org.jetbrains.exposed.sql.SqlExpressionBuilder.eq
|
import org.jetbrains.exposed.v1.core.inList
|
||||||
import org.jetbrains.exposed.sql.SqlExpressionBuilder.inList
|
import org.jetbrains.exposed.v1.core.like
|
||||||
import org.jetbrains.exposed.sql.SqlExpressionBuilder.like
|
import org.jetbrains.exposed.v1.core.or
|
||||||
import org.jetbrains.exposed.sql.deleteWhere
|
import org.jetbrains.exposed.v1.jdbc.deleteWhere
|
||||||
import org.jetbrains.exposed.sql.or
|
import org.jetbrains.exposed.v1.jdbc.selectAll
|
||||||
import org.jetbrains.exposed.sql.selectAll
|
import org.jetbrains.exposed.v1.jdbc.transactions.transaction
|
||||||
import org.jetbrains.exposed.sql.transactions.transaction
|
|
||||||
import suwayomi.tachidesk.global.impl.GlobalMeta
|
import suwayomi.tachidesk.global.impl.GlobalMeta
|
||||||
import suwayomi.tachidesk.global.model.table.GlobalMetaTable
|
import suwayomi.tachidesk.global.model.table.GlobalMetaTable
|
||||||
import suwayomi.tachidesk.graphql.directives.RequireAuth
|
import suwayomi.tachidesk.graphql.directives.RequireAuth
|
||||||
|
|||||||
@@ -7,16 +7,16 @@ import androidx.preference.EditTextPreference
|
|||||||
import androidx.preference.ListPreference
|
import androidx.preference.ListPreference
|
||||||
import androidx.preference.MultiSelectListPreference
|
import androidx.preference.MultiSelectListPreference
|
||||||
import androidx.preference.SwitchPreferenceCompat
|
import androidx.preference.SwitchPreferenceCompat
|
||||||
import org.jetbrains.exposed.sql.LikePattern
|
import org.jetbrains.exposed.v1.core.LikePattern
|
||||||
import org.jetbrains.exposed.sql.Op
|
import org.jetbrains.exposed.v1.core.Op
|
||||||
import org.jetbrains.exposed.sql.SqlExpressionBuilder.eq
|
import org.jetbrains.exposed.v1.core.and
|
||||||
import org.jetbrains.exposed.sql.SqlExpressionBuilder.inList
|
import org.jetbrains.exposed.v1.core.eq
|
||||||
import org.jetbrains.exposed.sql.SqlExpressionBuilder.like
|
import org.jetbrains.exposed.v1.core.inList
|
||||||
import org.jetbrains.exposed.sql.and
|
import org.jetbrains.exposed.v1.core.like
|
||||||
import org.jetbrains.exposed.sql.deleteWhere
|
import org.jetbrains.exposed.v1.core.or
|
||||||
import org.jetbrains.exposed.sql.or
|
import org.jetbrains.exposed.v1.jdbc.deleteWhere
|
||||||
import org.jetbrains.exposed.sql.selectAll
|
import org.jetbrains.exposed.v1.jdbc.selectAll
|
||||||
import org.jetbrains.exposed.sql.transactions.transaction
|
import org.jetbrains.exposed.v1.jdbc.transactions.transaction
|
||||||
import suwayomi.tachidesk.graphql.directives.RequireAuth
|
import suwayomi.tachidesk.graphql.directives.RequireAuth
|
||||||
import suwayomi.tachidesk.graphql.types.FilterChange
|
import suwayomi.tachidesk.graphql.types.FilterChange
|
||||||
import suwayomi.tachidesk.graphql.types.MangaType
|
import suwayomi.tachidesk.graphql.types.MangaType
|
||||||
|
|||||||
@@ -4,10 +4,10 @@ package suwayomi.tachidesk.graphql.mutations
|
|||||||
|
|
||||||
import com.expediagroup.graphql.generator.annotations.GraphQLDeprecated
|
import com.expediagroup.graphql.generator.annotations.GraphQLDeprecated
|
||||||
import com.expediagroup.graphql.generator.annotations.GraphQLDescription
|
import com.expediagroup.graphql.generator.annotations.GraphQLDescription
|
||||||
import graphql.execution.DataFetcherResult
|
import org.jetbrains.exposed.v1.core.and
|
||||||
import org.jetbrains.exposed.sql.and
|
import org.jetbrains.exposed.v1.core.eq
|
||||||
import org.jetbrains.exposed.sql.selectAll
|
import org.jetbrains.exposed.v1.jdbc.selectAll
|
||||||
import org.jetbrains.exposed.sql.transactions.transaction
|
import org.jetbrains.exposed.v1.jdbc.transactions.transaction
|
||||||
import suwayomi.tachidesk.graphql.directives.RequireAuth
|
import suwayomi.tachidesk.graphql.directives.RequireAuth
|
||||||
import suwayomi.tachidesk.graphql.types.TrackRecordType
|
import suwayomi.tachidesk.graphql.types.TrackRecordType
|
||||||
import suwayomi.tachidesk.graphql.types.TrackerType
|
import suwayomi.tachidesk.graphql.types.TrackerType
|
||||||
|
|||||||
@@ -2,7 +2,6 @@
|
|||||||
|
|
||||||
package suwayomi.tachidesk.graphql.mutations
|
package suwayomi.tachidesk.graphql.mutations
|
||||||
|
|
||||||
import graphql.execution.DataFetcherResult
|
|
||||||
import kotlinx.coroutines.flow.first
|
import kotlinx.coroutines.flow.first
|
||||||
import kotlinx.coroutines.withTimeout
|
import kotlinx.coroutines.withTimeout
|
||||||
import suwayomi.tachidesk.graphql.directives.RequireAuth
|
import suwayomi.tachidesk.graphql.directives.RequireAuth
|
||||||
|
|||||||
@@ -4,7 +4,6 @@ package suwayomi.tachidesk.graphql.mutations
|
|||||||
|
|
||||||
import graphql.schema.DataFetchingEnvironment
|
import graphql.schema.DataFetchingEnvironment
|
||||||
import suwayomi.tachidesk.global.impl.util.Jwt
|
import suwayomi.tachidesk.global.impl.util.Jwt
|
||||||
import suwayomi.tachidesk.graphql.directives.RequireAuth
|
|
||||||
import suwayomi.tachidesk.graphql.server.getAttribute
|
import suwayomi.tachidesk.graphql.server.getAttribute
|
||||||
import suwayomi.tachidesk.server.JavalinSetup.Attribute
|
import suwayomi.tachidesk.server.JavalinSetup.Attribute
|
||||||
import suwayomi.tachidesk.server.serverConfig
|
import suwayomi.tachidesk.server.serverConfig
|
||||||
|
|||||||
@@ -10,13 +10,13 @@ package suwayomi.tachidesk.graphql.queries
|
|||||||
import com.expediagroup.graphql.generator.annotations.GraphQLDeprecated
|
import com.expediagroup.graphql.generator.annotations.GraphQLDeprecated
|
||||||
import com.expediagroup.graphql.server.extensions.getValueFromDataLoader
|
import com.expediagroup.graphql.server.extensions.getValueFromDataLoader
|
||||||
import graphql.schema.DataFetchingEnvironment
|
import graphql.schema.DataFetchingEnvironment
|
||||||
import org.jetbrains.exposed.sql.Column
|
import org.jetbrains.exposed.v1.core.Column
|
||||||
import org.jetbrains.exposed.sql.Op
|
import org.jetbrains.exposed.v1.core.Op
|
||||||
import org.jetbrains.exposed.sql.SortOrder
|
import org.jetbrains.exposed.v1.core.SortOrder
|
||||||
import org.jetbrains.exposed.sql.SqlExpressionBuilder.greater
|
import org.jetbrains.exposed.v1.core.greater
|
||||||
import org.jetbrains.exposed.sql.SqlExpressionBuilder.less
|
import org.jetbrains.exposed.v1.core.less
|
||||||
import org.jetbrains.exposed.sql.selectAll
|
import org.jetbrains.exposed.v1.jdbc.selectAll
|
||||||
import org.jetbrains.exposed.sql.transactions.transaction
|
import org.jetbrains.exposed.v1.jdbc.transactions.transaction
|
||||||
import suwayomi.tachidesk.graphql.directives.RequireAuth
|
import suwayomi.tachidesk.graphql.directives.RequireAuth
|
||||||
import suwayomi.tachidesk.graphql.queries.filter.BooleanFilter
|
import suwayomi.tachidesk.graphql.queries.filter.BooleanFilter
|
||||||
import suwayomi.tachidesk.graphql.queries.filter.Filter
|
import suwayomi.tachidesk.graphql.queries.filter.Filter
|
||||||
|
|||||||
@@ -10,14 +10,14 @@ package suwayomi.tachidesk.graphql.queries
|
|||||||
import com.expediagroup.graphql.generator.annotations.GraphQLDeprecated
|
import com.expediagroup.graphql.generator.annotations.GraphQLDeprecated
|
||||||
import com.expediagroup.graphql.server.extensions.getValueFromDataLoader
|
import com.expediagroup.graphql.server.extensions.getValueFromDataLoader
|
||||||
import graphql.schema.DataFetchingEnvironment
|
import graphql.schema.DataFetchingEnvironment
|
||||||
import org.jetbrains.exposed.sql.Column
|
import org.jetbrains.exposed.v1.core.Column
|
||||||
import org.jetbrains.exposed.sql.Op
|
import org.jetbrains.exposed.v1.core.Op
|
||||||
import org.jetbrains.exposed.sql.SortOrder
|
import org.jetbrains.exposed.v1.core.SortOrder
|
||||||
import org.jetbrains.exposed.sql.SqlExpressionBuilder.greater
|
import org.jetbrains.exposed.v1.core.greater
|
||||||
import org.jetbrains.exposed.sql.SqlExpressionBuilder.less
|
import org.jetbrains.exposed.v1.core.less
|
||||||
import org.jetbrains.exposed.sql.andWhere
|
import org.jetbrains.exposed.v1.jdbc.andWhere
|
||||||
import org.jetbrains.exposed.sql.selectAll
|
import org.jetbrains.exposed.v1.jdbc.selectAll
|
||||||
import org.jetbrains.exposed.sql.transactions.transaction
|
import org.jetbrains.exposed.v1.jdbc.transactions.transaction
|
||||||
import suwayomi.tachidesk.graphql.directives.RequireAuth
|
import suwayomi.tachidesk.graphql.directives.RequireAuth
|
||||||
import suwayomi.tachidesk.graphql.queries.filter.BooleanFilter
|
import suwayomi.tachidesk.graphql.queries.filter.BooleanFilter
|
||||||
import suwayomi.tachidesk.graphql.queries.filter.DoubleFilter
|
import suwayomi.tachidesk.graphql.queries.filter.DoubleFilter
|
||||||
|
|||||||
@@ -11,14 +11,14 @@ import com.expediagroup.graphql.generator.annotations.GraphQLDeprecated
|
|||||||
import com.expediagroup.graphql.server.extensions.getValueFromDataLoader
|
import com.expediagroup.graphql.server.extensions.getValueFromDataLoader
|
||||||
import eu.kanade.tachiyomi.source.local.LocalSource
|
import eu.kanade.tachiyomi.source.local.LocalSource
|
||||||
import graphql.schema.DataFetchingEnvironment
|
import graphql.schema.DataFetchingEnvironment
|
||||||
import org.jetbrains.exposed.sql.Column
|
import org.jetbrains.exposed.v1.core.Column
|
||||||
import org.jetbrains.exposed.sql.Op
|
import org.jetbrains.exposed.v1.core.Op
|
||||||
import org.jetbrains.exposed.sql.SortOrder
|
import org.jetbrains.exposed.v1.core.SortOrder
|
||||||
import org.jetbrains.exposed.sql.SqlExpressionBuilder.greater
|
import org.jetbrains.exposed.v1.core.greater
|
||||||
import org.jetbrains.exposed.sql.SqlExpressionBuilder.less
|
import org.jetbrains.exposed.v1.core.less
|
||||||
import org.jetbrains.exposed.sql.SqlExpressionBuilder.neq
|
import org.jetbrains.exposed.v1.core.neq
|
||||||
import org.jetbrains.exposed.sql.selectAll
|
import org.jetbrains.exposed.v1.jdbc.selectAll
|
||||||
import org.jetbrains.exposed.sql.transactions.transaction
|
import org.jetbrains.exposed.v1.jdbc.transactions.transaction
|
||||||
import suwayomi.tachidesk.graphql.directives.RequireAuth
|
import suwayomi.tachidesk.graphql.directives.RequireAuth
|
||||||
import suwayomi.tachidesk.graphql.queries.filter.BooleanFilter
|
import suwayomi.tachidesk.graphql.queries.filter.BooleanFilter
|
||||||
import suwayomi.tachidesk.graphql.queries.filter.Filter
|
import suwayomi.tachidesk.graphql.queries.filter.Filter
|
||||||
|
|||||||
@@ -10,12 +10,15 @@ package suwayomi.tachidesk.graphql.queries
|
|||||||
import com.expediagroup.graphql.generator.annotations.GraphQLDeprecated
|
import com.expediagroup.graphql.generator.annotations.GraphQLDeprecated
|
||||||
import com.expediagroup.graphql.server.extensions.getValueFromDataLoader
|
import com.expediagroup.graphql.server.extensions.getValueFromDataLoader
|
||||||
import graphql.schema.DataFetchingEnvironment
|
import graphql.schema.DataFetchingEnvironment
|
||||||
import org.jetbrains.exposed.sql.Column
|
import org.jetbrains.exposed.v1.core.Column
|
||||||
import org.jetbrains.exposed.sql.Op
|
import org.jetbrains.exposed.v1.core.Op
|
||||||
import org.jetbrains.exposed.sql.SortOrder
|
import org.jetbrains.exposed.v1.core.SortOrder
|
||||||
import org.jetbrains.exposed.sql.SqlExpressionBuilder.greater
|
import org.jetbrains.exposed.v1.core.greater
|
||||||
import org.jetbrains.exposed.sql.SqlExpressionBuilder.less
|
import org.jetbrains.exposed.v1.core.inList
|
||||||
import org.jetbrains.exposed.sql.transactions.transaction
|
import org.jetbrains.exposed.v1.core.less
|
||||||
|
import org.jetbrains.exposed.v1.core.like
|
||||||
|
import org.jetbrains.exposed.v1.jdbc.select
|
||||||
|
import org.jetbrains.exposed.v1.jdbc.transactions.transaction
|
||||||
import suwayomi.tachidesk.graphql.directives.RequireAuth
|
import suwayomi.tachidesk.graphql.directives.RequireAuth
|
||||||
import suwayomi.tachidesk.graphql.queries.filter.BooleanFilter
|
import suwayomi.tachidesk.graphql.queries.filter.BooleanFilter
|
||||||
import suwayomi.tachidesk.graphql.queries.filter.ComparableScalarFilter
|
import suwayomi.tachidesk.graphql.queries.filter.ComparableScalarFilter
|
||||||
|
|||||||
@@ -10,13 +10,13 @@ package suwayomi.tachidesk.graphql.queries
|
|||||||
import com.expediagroup.graphql.generator.annotations.GraphQLDeprecated
|
import com.expediagroup.graphql.generator.annotations.GraphQLDeprecated
|
||||||
import com.expediagroup.graphql.server.extensions.getValueFromDataLoader
|
import com.expediagroup.graphql.server.extensions.getValueFromDataLoader
|
||||||
import graphql.schema.DataFetchingEnvironment
|
import graphql.schema.DataFetchingEnvironment
|
||||||
import org.jetbrains.exposed.sql.Column
|
import org.jetbrains.exposed.v1.core.Column
|
||||||
import org.jetbrains.exposed.sql.Op
|
import org.jetbrains.exposed.v1.core.Op
|
||||||
import org.jetbrains.exposed.sql.SortOrder
|
import org.jetbrains.exposed.v1.core.SortOrder
|
||||||
import org.jetbrains.exposed.sql.SqlExpressionBuilder.greater
|
import org.jetbrains.exposed.v1.core.greater
|
||||||
import org.jetbrains.exposed.sql.SqlExpressionBuilder.less
|
import org.jetbrains.exposed.v1.core.less
|
||||||
import org.jetbrains.exposed.sql.selectAll
|
import org.jetbrains.exposed.v1.jdbc.selectAll
|
||||||
import org.jetbrains.exposed.sql.transactions.transaction
|
import org.jetbrains.exposed.v1.jdbc.transactions.transaction
|
||||||
import suwayomi.tachidesk.global.model.table.GlobalMetaTable
|
import suwayomi.tachidesk.global.model.table.GlobalMetaTable
|
||||||
import suwayomi.tachidesk.graphql.directives.RequireAuth
|
import suwayomi.tachidesk.graphql.directives.RequireAuth
|
||||||
import suwayomi.tachidesk.graphql.queries.filter.Filter
|
import suwayomi.tachidesk.graphql.queries.filter.Filter
|
||||||
|
|||||||
@@ -10,13 +10,13 @@ package suwayomi.tachidesk.graphql.queries
|
|||||||
import com.expediagroup.graphql.generator.annotations.GraphQLDeprecated
|
import com.expediagroup.graphql.generator.annotations.GraphQLDeprecated
|
||||||
import com.expediagroup.graphql.server.extensions.getValueFromDataLoader
|
import com.expediagroup.graphql.server.extensions.getValueFromDataLoader
|
||||||
import graphql.schema.DataFetchingEnvironment
|
import graphql.schema.DataFetchingEnvironment
|
||||||
import org.jetbrains.exposed.sql.Column
|
import org.jetbrains.exposed.v1.core.Column
|
||||||
import org.jetbrains.exposed.sql.Op
|
import org.jetbrains.exposed.v1.core.Op
|
||||||
import org.jetbrains.exposed.sql.SortOrder
|
import org.jetbrains.exposed.v1.core.SortOrder
|
||||||
import org.jetbrains.exposed.sql.SqlExpressionBuilder.greater
|
import org.jetbrains.exposed.v1.core.greater
|
||||||
import org.jetbrains.exposed.sql.SqlExpressionBuilder.less
|
import org.jetbrains.exposed.v1.core.less
|
||||||
import org.jetbrains.exposed.sql.selectAll
|
import org.jetbrains.exposed.v1.jdbc.selectAll
|
||||||
import org.jetbrains.exposed.sql.transactions.transaction
|
import org.jetbrains.exposed.v1.jdbc.transactions.transaction
|
||||||
import suwayomi.tachidesk.graphql.directives.RequireAuth
|
import suwayomi.tachidesk.graphql.directives.RequireAuth
|
||||||
import suwayomi.tachidesk.graphql.queries.filter.BooleanFilter
|
import suwayomi.tachidesk.graphql.queries.filter.BooleanFilter
|
||||||
import suwayomi.tachidesk.graphql.queries.filter.Filter
|
import suwayomi.tachidesk.graphql.queries.filter.Filter
|
||||||
|
|||||||
@@ -3,13 +3,13 @@ package suwayomi.tachidesk.graphql.queries
|
|||||||
import com.expediagroup.graphql.generator.annotations.GraphQLDeprecated
|
import com.expediagroup.graphql.generator.annotations.GraphQLDeprecated
|
||||||
import com.expediagroup.graphql.server.extensions.getValueFromDataLoader
|
import com.expediagroup.graphql.server.extensions.getValueFromDataLoader
|
||||||
import graphql.schema.DataFetchingEnvironment
|
import graphql.schema.DataFetchingEnvironment
|
||||||
import org.jetbrains.exposed.sql.Column
|
import org.jetbrains.exposed.v1.core.Column
|
||||||
import org.jetbrains.exposed.sql.Op
|
import org.jetbrains.exposed.v1.core.Op
|
||||||
import org.jetbrains.exposed.sql.SortOrder
|
import org.jetbrains.exposed.v1.core.SortOrder
|
||||||
import org.jetbrains.exposed.sql.SqlExpressionBuilder.greater
|
import org.jetbrains.exposed.v1.core.greater
|
||||||
import org.jetbrains.exposed.sql.SqlExpressionBuilder.less
|
import org.jetbrains.exposed.v1.core.less
|
||||||
import org.jetbrains.exposed.sql.selectAll
|
import org.jetbrains.exposed.v1.jdbc.selectAll
|
||||||
import org.jetbrains.exposed.sql.transactions.transaction
|
import org.jetbrains.exposed.v1.jdbc.transactions.transaction
|
||||||
import suwayomi.tachidesk.graphql.directives.RequireAuth
|
import suwayomi.tachidesk.graphql.directives.RequireAuth
|
||||||
import suwayomi.tachidesk.graphql.queries.filter.BooleanFilter
|
import suwayomi.tachidesk.graphql.queries.filter.BooleanFilter
|
||||||
import suwayomi.tachidesk.graphql.queries.filter.DoubleFilter
|
import suwayomi.tachidesk.graphql.queries.filter.DoubleFilter
|
||||||
|
|||||||
@@ -1,21 +1,33 @@
|
|||||||
package suwayomi.tachidesk.graphql.queries.filter
|
package suwayomi.tachidesk.graphql.queries.filter
|
||||||
|
|
||||||
import org.jetbrains.exposed.dao.id.EntityID
|
import org.jetbrains.exposed.v1.core.Column
|
||||||
import org.jetbrains.exposed.sql.Column
|
import org.jetbrains.exposed.v1.core.ComparisonOp
|
||||||
import org.jetbrains.exposed.sql.ComparisonOp
|
import org.jetbrains.exposed.v1.core.Expression
|
||||||
import org.jetbrains.exposed.sql.Expression
|
import org.jetbrains.exposed.v1.core.ExpressionWithColumnType
|
||||||
import org.jetbrains.exposed.sql.ExpressionWithColumnType
|
import org.jetbrains.exposed.v1.core.LikePattern
|
||||||
import org.jetbrains.exposed.sql.LikePattern
|
import org.jetbrains.exposed.v1.core.Op
|
||||||
import org.jetbrains.exposed.sql.Op
|
import org.jetbrains.exposed.v1.core.QueryBuilder
|
||||||
import org.jetbrains.exposed.sql.Query
|
import org.jetbrains.exposed.v1.core.and
|
||||||
import org.jetbrains.exposed.sql.QueryBuilder
|
import org.jetbrains.exposed.v1.core.dao.id.EntityID
|
||||||
import org.jetbrains.exposed.sql.SqlExpressionBuilder
|
import org.jetbrains.exposed.v1.core.eq
|
||||||
import org.jetbrains.exposed.sql.and
|
import org.jetbrains.exposed.v1.core.greater
|
||||||
import org.jetbrains.exposed.sql.andWhere
|
import org.jetbrains.exposed.v1.core.greaterEq
|
||||||
import org.jetbrains.exposed.sql.not
|
import org.jetbrains.exposed.v1.core.inList
|
||||||
import org.jetbrains.exposed.sql.or
|
import org.jetbrains.exposed.v1.core.isNotNull
|
||||||
import org.jetbrains.exposed.sql.stringParam
|
import org.jetbrains.exposed.v1.core.isNull
|
||||||
import org.jetbrains.exposed.sql.upperCase
|
import org.jetbrains.exposed.v1.core.less
|
||||||
|
import org.jetbrains.exposed.v1.core.lessEq
|
||||||
|
import org.jetbrains.exposed.v1.core.like
|
||||||
|
import org.jetbrains.exposed.v1.core.neq
|
||||||
|
import org.jetbrains.exposed.v1.core.not
|
||||||
|
import org.jetbrains.exposed.v1.core.notInList
|
||||||
|
import org.jetbrains.exposed.v1.core.notLike
|
||||||
|
import org.jetbrains.exposed.v1.core.or
|
||||||
|
import org.jetbrains.exposed.v1.core.stringParam
|
||||||
|
import org.jetbrains.exposed.v1.core.upperCase
|
||||||
|
import org.jetbrains.exposed.v1.core.wrap
|
||||||
|
import org.jetbrains.exposed.v1.jdbc.Query
|
||||||
|
import org.jetbrains.exposed.v1.jdbc.andWhere
|
||||||
|
|
||||||
class ILikeEscapeOp(
|
class ILikeEscapeOp(
|
||||||
expr1: Expression<*>,
|
expr1: Expression<*>,
|
||||||
@@ -88,9 +100,7 @@ class DistinctFromOp(
|
|||||||
): DistinctFromOp =
|
): DistinctFromOp =
|
||||||
DistinctFromOp(
|
DistinctFromOp(
|
||||||
expression,
|
expression,
|
||||||
with(SqlExpressionBuilder) {
|
expression.wrap(t),
|
||||||
expression.wrap(t)
|
|
||||||
},
|
|
||||||
false,
|
false,
|
||||||
)
|
)
|
||||||
|
|
||||||
@@ -100,9 +110,7 @@ class DistinctFromOp(
|
|||||||
): DistinctFromOp =
|
): DistinctFromOp =
|
||||||
DistinctFromOp(
|
DistinctFromOp(
|
||||||
expression,
|
expression,
|
||||||
with(SqlExpressionBuilder) {
|
expression.wrap(t),
|
||||||
expression.wrap(t)
|
|
||||||
},
|
|
||||||
true,
|
true,
|
||||||
)
|
)
|
||||||
|
|
||||||
@@ -112,9 +120,7 @@ class DistinctFromOp(
|
|||||||
): DistinctFromOp =
|
): DistinctFromOp =
|
||||||
DistinctFromOp(
|
DistinctFromOp(
|
||||||
expression,
|
expression,
|
||||||
with(SqlExpressionBuilder) {
|
expression.wrap(t),
|
||||||
expression.wrap(t)
|
|
||||||
},
|
|
||||||
false,
|
false,
|
||||||
)
|
)
|
||||||
|
|
||||||
@@ -124,9 +130,7 @@ class DistinctFromOp(
|
|||||||
): DistinctFromOp =
|
): DistinctFromOp =
|
||||||
DistinctFromOp(
|
DistinctFromOp(
|
||||||
expression,
|
expression,
|
||||||
with(SqlExpressionBuilder) {
|
expression.wrap(t),
|
||||||
expression.wrap(t)
|
|
||||||
},
|
|
||||||
true,
|
true,
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
@@ -505,26 +509,26 @@ class OpAnd(
|
|||||||
) {
|
) {
|
||||||
fun <T> andWhere(
|
fun <T> andWhere(
|
||||||
value: T?,
|
value: T?,
|
||||||
andPart: SqlExpressionBuilder.(T & Any) -> Op<Boolean>,
|
andPart: (T & Any) -> Op<Boolean>,
|
||||||
) {
|
) {
|
||||||
value ?: return
|
value ?: return
|
||||||
val expr = Op.build { andPart(value) }
|
val expr = andPart(value)
|
||||||
op = if (op == null) expr else (op!! and expr)
|
op = if (op == null) expr else (op!! and expr)
|
||||||
}
|
}
|
||||||
|
|
||||||
fun <T : Any> andWhere(
|
fun <T : Any> andWhere(
|
||||||
values: List<T>?,
|
values: List<T>?,
|
||||||
andPart: SqlExpressionBuilder.(List<T>) -> Op<Boolean>,
|
andPart: (List<T>) -> Op<Boolean>,
|
||||||
) {
|
) {
|
||||||
@Suppress("UNCHECKED_CAST")
|
@Suppress("UNCHECKED_CAST")
|
||||||
return andWhere(values as T?, andPart as SqlExpressionBuilder.(Any) -> Op<Boolean>)
|
return andWhere(values as T?, andPart as (Any) -> Op<Boolean>)
|
||||||
}
|
}
|
||||||
|
|
||||||
fun <T : Any> andWhere(
|
fun <T : Any> andWhere(
|
||||||
valueDefault: T?,
|
valueDefault: T?,
|
||||||
valueAll: List<T>?,
|
valueAll: List<T>?,
|
||||||
valueAny: List<T>?,
|
valueAny: List<T>?,
|
||||||
expr: SqlExpressionBuilder.(T) -> Op<Boolean>,
|
expr: (T) -> Op<Boolean>,
|
||||||
) {
|
) {
|
||||||
andWhere(valueDefault, expr)
|
andWhere(valueDefault, expr)
|
||||||
andWhereAll(valueAll, expr)
|
andWhereAll(valueAll, expr)
|
||||||
@@ -533,17 +537,17 @@ class OpAnd(
|
|||||||
|
|
||||||
fun <T : Any> andWhereAll(
|
fun <T : Any> andWhereAll(
|
||||||
values: List<T>?,
|
values: List<T>?,
|
||||||
andPart: SqlExpressionBuilder.(T) -> Op<Boolean>,
|
andPart: (T) -> Op<Boolean>,
|
||||||
) {
|
) {
|
||||||
values?.map { andWhere(it, andPart) }
|
values?.map { andWhere(it, andPart) }
|
||||||
}
|
}
|
||||||
|
|
||||||
fun <T : Any> andWhereAny(
|
fun <T : Any> andWhereAny(
|
||||||
values: List<T>?,
|
values: List<T>?,
|
||||||
andPart: SqlExpressionBuilder.(T) -> Op<Boolean>,
|
andPart: (T) -> Op<Boolean>,
|
||||||
) {
|
) {
|
||||||
values ?: return
|
values ?: return
|
||||||
val expr = values.map { Op.build { andPart(it) } }.reduce { acc, op -> acc or op }
|
val expr = values.map { andPart(it) }.reduce { acc, op -> acc or op }
|
||||||
op = if (op == null) expr else (op!! and expr)
|
op = if (op == null) expr else (op!! and expr)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -14,7 +14,6 @@ import com.expediagroup.graphql.server.types.GraphQLServerRequest
|
|||||||
import io.github.oshai.kotlinlogging.KotlinLogging
|
import io.github.oshai.kotlinlogging.KotlinLogging
|
||||||
import io.javalin.http.Context
|
import io.javalin.http.Context
|
||||||
import io.javalin.http.UploadedFile
|
import io.javalin.http.UploadedFile
|
||||||
import io.javalin.json.JavalinJackson
|
|
||||||
import io.javalin.json.fromJsonStream
|
import io.javalin.json.fromJsonStream
|
||||||
import io.javalin.json.fromJsonString
|
import io.javalin.json.fromJsonString
|
||||||
import java.io.IOException
|
import java.io.IOException
|
||||||
|
|||||||
@@ -15,7 +15,6 @@ import graphql.GraphQL
|
|||||||
import graphql.execution.AsyncExecutionStrategy
|
import graphql.execution.AsyncExecutionStrategy
|
||||||
import graphql.execution.DataFetcherExceptionHandler
|
import graphql.execution.DataFetcherExceptionHandler
|
||||||
import graphql.execution.DataFetcherExceptionHandlerResult
|
import graphql.execution.DataFetcherExceptionHandlerResult
|
||||||
import graphql.schema.idl.RuntimeWiring
|
|
||||||
import io.github.oshai.kotlinlogging.KotlinLogging
|
import io.github.oshai.kotlinlogging.KotlinLogging
|
||||||
import io.javalin.http.Context
|
import io.javalin.http.Context
|
||||||
import io.javalin.websocket.WsCloseContext
|
import io.javalin.websocket.WsCloseContext
|
||||||
|
|||||||
@@ -1,16 +1,16 @@
|
|||||||
package suwayomi.tachidesk.graphql.server.primitives
|
package suwayomi.tachidesk.graphql.server.primitives
|
||||||
|
|
||||||
import org.jetbrains.exposed.dao.id.EntityID
|
import org.jetbrains.exposed.v1.core.Column
|
||||||
import org.jetbrains.exposed.sql.Column
|
import org.jetbrains.exposed.v1.core.Op
|
||||||
import org.jetbrains.exposed.sql.Op
|
import org.jetbrains.exposed.v1.core.SortOrder
|
||||||
import org.jetbrains.exposed.sql.Query
|
import org.jetbrains.exposed.v1.core.and
|
||||||
import org.jetbrains.exposed.sql.SortOrder
|
import org.jetbrains.exposed.v1.core.dao.id.EntityID
|
||||||
import org.jetbrains.exposed.sql.SqlExpressionBuilder.eq
|
import org.jetbrains.exposed.v1.core.eq
|
||||||
import org.jetbrains.exposed.sql.SqlExpressionBuilder.greater
|
import org.jetbrains.exposed.v1.core.greater
|
||||||
import org.jetbrains.exposed.sql.SqlExpressionBuilder.less
|
import org.jetbrains.exposed.v1.core.less
|
||||||
import org.jetbrains.exposed.sql.and
|
import org.jetbrains.exposed.v1.core.or
|
||||||
import org.jetbrains.exposed.sql.andWhere
|
import org.jetbrains.exposed.v1.jdbc.Query
|
||||||
import org.jetbrains.exposed.sql.or
|
import org.jetbrains.exposed.v1.jdbc.andWhere
|
||||||
|
|
||||||
interface OrderBy<T> {
|
interface OrderBy<T> {
|
||||||
val column: Column<*>
|
val column: Column<*>
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
package suwayomi.tachidesk.graphql.server.primitives
|
package suwayomi.tachidesk.graphql.server.primitives
|
||||||
|
|
||||||
import org.jetbrains.exposed.sql.ResultRow
|
import org.jetbrains.exposed.v1.core.ResultRow
|
||||||
|
|
||||||
data class QueryResults<T>(
|
data class QueryResults<T>(
|
||||||
val total: Long,
|
val total: Long,
|
||||||
|
|||||||
@@ -9,7 +9,7 @@ package suwayomi.tachidesk.graphql.types
|
|||||||
|
|
||||||
import com.expediagroup.graphql.server.extensions.getValueFromDataLoader
|
import com.expediagroup.graphql.server.extensions.getValueFromDataLoader
|
||||||
import graphql.schema.DataFetchingEnvironment
|
import graphql.schema.DataFetchingEnvironment
|
||||||
import org.jetbrains.exposed.sql.ResultRow
|
import org.jetbrains.exposed.v1.core.ResultRow
|
||||||
import suwayomi.tachidesk.graphql.server.primitives.Cursor
|
import suwayomi.tachidesk.graphql.server.primitives.Cursor
|
||||||
import suwayomi.tachidesk.graphql.server.primitives.Edge
|
import suwayomi.tachidesk.graphql.server.primitives.Edge
|
||||||
import suwayomi.tachidesk.graphql.server.primitives.Node
|
import suwayomi.tachidesk.graphql.server.primitives.Node
|
||||||
|
|||||||
@@ -9,7 +9,7 @@ package suwayomi.tachidesk.graphql.types
|
|||||||
|
|
||||||
import com.expediagroup.graphql.server.extensions.getValueFromDataLoader
|
import com.expediagroup.graphql.server.extensions.getValueFromDataLoader
|
||||||
import graphql.schema.DataFetchingEnvironment
|
import graphql.schema.DataFetchingEnvironment
|
||||||
import org.jetbrains.exposed.sql.ResultRow
|
import org.jetbrains.exposed.v1.core.ResultRow
|
||||||
import suwayomi.tachidesk.graphql.server.primitives.Cursor
|
import suwayomi.tachidesk.graphql.server.primitives.Cursor
|
||||||
import suwayomi.tachidesk.graphql.server.primitives.Edge
|
import suwayomi.tachidesk.graphql.server.primitives.Edge
|
||||||
import suwayomi.tachidesk.graphql.server.primitives.Node
|
import suwayomi.tachidesk.graphql.server.primitives.Node
|
||||||
|
|||||||
@@ -9,7 +9,7 @@ package suwayomi.tachidesk.graphql.types
|
|||||||
|
|
||||||
import com.expediagroup.graphql.server.extensions.getValueFromDataLoader
|
import com.expediagroup.graphql.server.extensions.getValueFromDataLoader
|
||||||
import graphql.schema.DataFetchingEnvironment
|
import graphql.schema.DataFetchingEnvironment
|
||||||
import org.jetbrains.exposed.sql.ResultRow
|
import org.jetbrains.exposed.v1.core.ResultRow
|
||||||
import suwayomi.tachidesk.graphql.server.primitives.Cursor
|
import suwayomi.tachidesk.graphql.server.primitives.Cursor
|
||||||
import suwayomi.tachidesk.graphql.server.primitives.Edge
|
import suwayomi.tachidesk.graphql.server.primitives.Edge
|
||||||
import suwayomi.tachidesk.graphql.server.primitives.Node
|
import suwayomi.tachidesk.graphql.server.primitives.Node
|
||||||
|
|||||||
@@ -10,7 +10,7 @@ package suwayomi.tachidesk.graphql.types
|
|||||||
import com.expediagroup.graphql.server.extensions.getValueFromDataLoader
|
import com.expediagroup.graphql.server.extensions.getValueFromDataLoader
|
||||||
import eu.kanade.tachiyomi.source.model.UpdateStrategy
|
import eu.kanade.tachiyomi.source.model.UpdateStrategy
|
||||||
import graphql.schema.DataFetchingEnvironment
|
import graphql.schema.DataFetchingEnvironment
|
||||||
import org.jetbrains.exposed.sql.ResultRow
|
import org.jetbrains.exposed.v1.core.ResultRow
|
||||||
import suwayomi.tachidesk.graphql.cache.CustomCacheMap
|
import suwayomi.tachidesk.graphql.cache.CustomCacheMap
|
||||||
import suwayomi.tachidesk.graphql.server.primitives.Cursor
|
import suwayomi.tachidesk.graphql.server.primitives.Cursor
|
||||||
import suwayomi.tachidesk.graphql.server.primitives.Edge
|
import suwayomi.tachidesk.graphql.server.primitives.Edge
|
||||||
|
|||||||
@@ -2,7 +2,7 @@ package suwayomi.tachidesk.graphql.types
|
|||||||
|
|
||||||
import com.expediagroup.graphql.server.extensions.getValueFromDataLoader
|
import com.expediagroup.graphql.server.extensions.getValueFromDataLoader
|
||||||
import graphql.schema.DataFetchingEnvironment
|
import graphql.schema.DataFetchingEnvironment
|
||||||
import org.jetbrains.exposed.sql.ResultRow
|
import org.jetbrains.exposed.v1.core.ResultRow
|
||||||
import suwayomi.tachidesk.global.model.table.GlobalMetaTable
|
import suwayomi.tachidesk.global.model.table.GlobalMetaTable
|
||||||
import suwayomi.tachidesk.graphql.server.primitives.Cursor
|
import suwayomi.tachidesk.graphql.server.primitives.Cursor
|
||||||
import suwayomi.tachidesk.graphql.server.primitives.Edge
|
import suwayomi.tachidesk.graphql.server.primitives.Edge
|
||||||
|
|||||||
@@ -13,8 +13,9 @@ import eu.kanade.tachiyomi.source.ConfigurableSource
|
|||||||
import eu.kanade.tachiyomi.source.model.FilterList
|
import eu.kanade.tachiyomi.source.model.FilterList
|
||||||
import eu.kanade.tachiyomi.source.online.HttpSource
|
import eu.kanade.tachiyomi.source.online.HttpSource
|
||||||
import graphql.schema.DataFetchingEnvironment
|
import graphql.schema.DataFetchingEnvironment
|
||||||
import org.jetbrains.exposed.sql.ResultRow
|
import org.jetbrains.exposed.v1.core.ResultRow
|
||||||
import org.jetbrains.exposed.sql.selectAll
|
import org.jetbrains.exposed.v1.core.eq
|
||||||
|
import org.jetbrains.exposed.v1.jdbc.selectAll
|
||||||
import suwayomi.tachidesk.graphql.server.primitives.Cursor
|
import suwayomi.tachidesk.graphql.server.primitives.Cursor
|
||||||
import suwayomi.tachidesk.graphql.server.primitives.Edge
|
import suwayomi.tachidesk.graphql.server.primitives.Edge
|
||||||
import suwayomi.tachidesk.graphql.server.primitives.Node
|
import suwayomi.tachidesk.graphql.server.primitives.Node
|
||||||
|
|||||||
@@ -2,7 +2,7 @@ package suwayomi.tachidesk.graphql.types
|
|||||||
|
|
||||||
import com.expediagroup.graphql.server.extensions.getValueFromDataLoader
|
import com.expediagroup.graphql.server.extensions.getValueFromDataLoader
|
||||||
import graphql.schema.DataFetchingEnvironment
|
import graphql.schema.DataFetchingEnvironment
|
||||||
import org.jetbrains.exposed.sql.ResultRow
|
import org.jetbrains.exposed.v1.core.ResultRow
|
||||||
import suwayomi.tachidesk.graphql.server.primitives.Cursor
|
import suwayomi.tachidesk.graphql.server.primitives.Cursor
|
||||||
import suwayomi.tachidesk.graphql.server.primitives.Edge
|
import suwayomi.tachidesk.graphql.server.primitives.Edge
|
||||||
import suwayomi.tachidesk.graphql.server.primitives.Node
|
import suwayomi.tachidesk.graphql.server.primitives.Node
|
||||||
|
|||||||
@@ -12,8 +12,9 @@ import io.javalin.http.HttpStatus
|
|||||||
import kotlinx.coroutines.GlobalScope
|
import kotlinx.coroutines.GlobalScope
|
||||||
import kotlinx.coroutines.launch
|
import kotlinx.coroutines.launch
|
||||||
import kotlinx.serialization.json.Json
|
import kotlinx.serialization.json.Json
|
||||||
import org.jetbrains.exposed.sql.transactions.transaction
|
import org.jetbrains.exposed.v1.core.eq
|
||||||
import org.jetbrains.exposed.sql.update
|
import org.jetbrains.exposed.v1.jdbc.transactions.transaction
|
||||||
|
import org.jetbrains.exposed.v1.jdbc.update
|
||||||
import suwayomi.tachidesk.manga.impl.CategoryManga
|
import suwayomi.tachidesk.manga.impl.CategoryManga
|
||||||
import suwayomi.tachidesk.manga.impl.Chapter
|
import suwayomi.tachidesk.manga.impl.Chapter
|
||||||
import suwayomi.tachidesk.manga.impl.ChapterDownloadHelper
|
import suwayomi.tachidesk.manga.impl.ChapterDownloadHelper
|
||||||
|
|||||||
@@ -7,25 +7,27 @@ package suwayomi.tachidesk.manga.impl
|
|||||||
* License, v. 2.0. If a copy of the MPL was not distributed with this
|
* 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/. */
|
* file, You can obtain one at https://mozilla.org/MPL/2.0/. */
|
||||||
|
|
||||||
import org.jetbrains.exposed.dao.id.EntityID
|
import org.jetbrains.exposed.v1.core.SortOrder
|
||||||
import org.jetbrains.exposed.sql.SortOrder
|
import org.jetbrains.exposed.v1.core.and
|
||||||
import org.jetbrains.exposed.sql.SqlExpressionBuilder.eq
|
import org.jetbrains.exposed.v1.core.dao.id.EntityID
|
||||||
import org.jetbrains.exposed.sql.and
|
import org.jetbrains.exposed.v1.core.eq
|
||||||
import org.jetbrains.exposed.sql.andWhere
|
import org.jetbrains.exposed.v1.core.inList
|
||||||
import org.jetbrains.exposed.sql.batchInsert
|
import org.jetbrains.exposed.v1.core.isNull
|
||||||
import org.jetbrains.exposed.sql.deleteWhere
|
import org.jetbrains.exposed.v1.core.neq
|
||||||
import org.jetbrains.exposed.sql.selectAll
|
import org.jetbrains.exposed.v1.core.statements.BatchUpdateStatement
|
||||||
import org.jetbrains.exposed.sql.statements.BatchUpdateStatement
|
import org.jetbrains.exposed.v1.jdbc.andWhere
|
||||||
import org.jetbrains.exposed.sql.transactions.transaction
|
import org.jetbrains.exposed.v1.jdbc.batchInsert
|
||||||
import org.jetbrains.exposed.sql.update
|
import org.jetbrains.exposed.v1.jdbc.deleteWhere
|
||||||
|
import org.jetbrains.exposed.v1.jdbc.selectAll
|
||||||
|
import org.jetbrains.exposed.v1.jdbc.statements.toExecutable
|
||||||
|
import org.jetbrains.exposed.v1.jdbc.transactions.transaction
|
||||||
|
import org.jetbrains.exposed.v1.jdbc.update
|
||||||
import suwayomi.tachidesk.manga.model.dataclass.CategoryDataClass
|
import suwayomi.tachidesk.manga.model.dataclass.CategoryDataClass
|
||||||
import suwayomi.tachidesk.manga.model.table.CategoryMangaTable
|
import suwayomi.tachidesk.manga.model.table.CategoryMangaTable
|
||||||
import suwayomi.tachidesk.manga.model.table.CategoryMetaTable
|
import suwayomi.tachidesk.manga.model.table.CategoryMetaTable
|
||||||
import suwayomi.tachidesk.manga.model.table.CategoryTable
|
import suwayomi.tachidesk.manga.model.table.CategoryTable
|
||||||
import suwayomi.tachidesk.manga.model.table.MangaTable
|
import suwayomi.tachidesk.manga.model.table.MangaTable
|
||||||
import suwayomi.tachidesk.manga.model.table.toDataClass
|
import suwayomi.tachidesk.manga.model.table.toDataClass
|
||||||
import kotlin.collections.component1
|
|
||||||
import kotlin.collections.orEmpty
|
|
||||||
|
|
||||||
object Category {
|
object Category {
|
||||||
/**
|
/**
|
||||||
@@ -248,13 +250,14 @@ object Category {
|
|||||||
}
|
}
|
||||||
|
|
||||||
if (existingMetaByMetaId.isNotEmpty()) {
|
if (existingMetaByMetaId.isNotEmpty()) {
|
||||||
BatchUpdateStatement(CategoryMetaTable).apply {
|
BatchUpdateStatement(CategoryMetaTable)
|
||||||
existingMetaByMetaId.forEach { (metaId, entry) ->
|
.apply {
|
||||||
addBatch(EntityID(metaId, CategoryMetaTable))
|
existingMetaByMetaId.forEach { (metaId, entry) ->
|
||||||
this[CategoryMetaTable.value] = entry.value
|
addBatch(EntityID(metaId, CategoryMetaTable))
|
||||||
}
|
this[CategoryMetaTable.value] = entry.value
|
||||||
execute(this@transaction)
|
}
|
||||||
}
|
}.toExecutable()
|
||||||
|
.execute(this@transaction)
|
||||||
}
|
}
|
||||||
|
|
||||||
if (newMetaByCategoryId.isNotEmpty()) {
|
if (newMetaByCategoryId.isNotEmpty()) {
|
||||||
|
|||||||
@@ -7,19 +7,22 @@ package suwayomi.tachidesk.manga.impl
|
|||||||
* License, v. 2.0. If a copy of the MPL was not distributed with this
|
* 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/. */
|
* file, You can obtain one at https://mozilla.org/MPL/2.0/. */
|
||||||
|
|
||||||
import org.jetbrains.exposed.sql.ResultRow
|
import org.jetbrains.exposed.v1.core.ResultRow
|
||||||
import org.jetbrains.exposed.sql.SortOrder
|
import org.jetbrains.exposed.v1.core.SortOrder
|
||||||
import org.jetbrains.exposed.sql.SqlExpressionBuilder.eq
|
import org.jetbrains.exposed.v1.core.alias
|
||||||
import org.jetbrains.exposed.sql.alias
|
import org.jetbrains.exposed.v1.core.and
|
||||||
import org.jetbrains.exposed.sql.and
|
import org.jetbrains.exposed.v1.core.count
|
||||||
import org.jetbrains.exposed.sql.batchInsert
|
import org.jetbrains.exposed.v1.core.eq
|
||||||
import org.jetbrains.exposed.sql.count
|
import org.jetbrains.exposed.v1.core.inList
|
||||||
import org.jetbrains.exposed.sql.deleteWhere
|
import org.jetbrains.exposed.v1.core.isNull
|
||||||
import org.jetbrains.exposed.sql.leftJoin
|
import org.jetbrains.exposed.v1.core.leftJoin
|
||||||
import org.jetbrains.exposed.sql.max
|
import org.jetbrains.exposed.v1.core.max
|
||||||
import org.jetbrains.exposed.sql.selectAll
|
import org.jetbrains.exposed.v1.core.wrapAsExpression
|
||||||
import org.jetbrains.exposed.sql.transactions.transaction
|
import org.jetbrains.exposed.v1.jdbc.batchInsert
|
||||||
import org.jetbrains.exposed.sql.wrapAsExpression
|
import org.jetbrains.exposed.v1.jdbc.deleteWhere
|
||||||
|
import org.jetbrains.exposed.v1.jdbc.select
|
||||||
|
import org.jetbrains.exposed.v1.jdbc.selectAll
|
||||||
|
import org.jetbrains.exposed.v1.jdbc.transactions.transaction
|
||||||
import suwayomi.tachidesk.manga.impl.Category.DEFAULT_CATEGORY_ID
|
import suwayomi.tachidesk.manga.impl.Category.DEFAULT_CATEGORY_ID
|
||||||
import suwayomi.tachidesk.manga.model.dataclass.CategoryDataClass
|
import suwayomi.tachidesk.manga.model.dataclass.CategoryDataClass
|
||||||
import suwayomi.tachidesk.manga.model.dataclass.MangaDataClass
|
import suwayomi.tachidesk.manga.model.dataclass.MangaDataClass
|
||||||
|
|||||||
@@ -17,17 +17,21 @@ import io.github.reactivecircus.cache4k.Cache
|
|||||||
import kotlinx.coroutines.sync.Mutex
|
import kotlinx.coroutines.sync.Mutex
|
||||||
import kotlinx.coroutines.sync.withLock
|
import kotlinx.coroutines.sync.withLock
|
||||||
import kotlinx.serialization.Serializable
|
import kotlinx.serialization.Serializable
|
||||||
import org.jetbrains.exposed.dao.id.EntityID
|
import org.jetbrains.exposed.v1.core.SortOrder
|
||||||
import org.jetbrains.exposed.sql.Op
|
import org.jetbrains.exposed.v1.core.and
|
||||||
import org.jetbrains.exposed.sql.SortOrder
|
import org.jetbrains.exposed.v1.core.dao.id.EntityID
|
||||||
import org.jetbrains.exposed.sql.SqlExpressionBuilder.inList
|
import org.jetbrains.exposed.v1.core.eq
|
||||||
import org.jetbrains.exposed.sql.and
|
import org.jetbrains.exposed.v1.core.greater
|
||||||
import org.jetbrains.exposed.sql.batchInsert
|
import org.jetbrains.exposed.v1.core.inList
|
||||||
import org.jetbrains.exposed.sql.deleteWhere
|
import org.jetbrains.exposed.v1.core.less
|
||||||
import org.jetbrains.exposed.sql.selectAll
|
import org.jetbrains.exposed.v1.core.statements.BatchUpdateStatement
|
||||||
import org.jetbrains.exposed.sql.statements.BatchUpdateStatement
|
import org.jetbrains.exposed.v1.jdbc.batchInsert
|
||||||
import org.jetbrains.exposed.sql.transactions.transaction
|
import org.jetbrains.exposed.v1.jdbc.deleteWhere
|
||||||
import org.jetbrains.exposed.sql.update
|
import org.jetbrains.exposed.v1.jdbc.select
|
||||||
|
import org.jetbrains.exposed.v1.jdbc.selectAll
|
||||||
|
import org.jetbrains.exposed.v1.jdbc.statements.toExecutable
|
||||||
|
import org.jetbrains.exposed.v1.jdbc.transactions.transaction
|
||||||
|
import org.jetbrains.exposed.v1.jdbc.update
|
||||||
import suwayomi.tachidesk.manga.impl.Manga.getManga
|
import suwayomi.tachidesk.manga.impl.Manga.getManga
|
||||||
import suwayomi.tachidesk.manga.impl.download.DownloadManager
|
import suwayomi.tachidesk.manga.impl.download.DownloadManager
|
||||||
import suwayomi.tachidesk.manga.impl.download.DownloadManager.EnqueueInput
|
import suwayomi.tachidesk.manga.impl.download.DownloadManager.EnqueueInput
|
||||||
@@ -306,18 +310,19 @@ object Chapter {
|
|||||||
}
|
}
|
||||||
|
|
||||||
if (chaptersToUpdate.isNotEmpty()) {
|
if (chaptersToUpdate.isNotEmpty()) {
|
||||||
BatchUpdateStatement(ChapterTable).apply {
|
BatchUpdateStatement(ChapterTable)
|
||||||
chaptersToUpdate.forEach {
|
.apply {
|
||||||
addBatch(EntityID(it.id, ChapterTable))
|
chaptersToUpdate.forEach {
|
||||||
this[ChapterTable.name] = it.name
|
addBatch(EntityID(it.id, ChapterTable))
|
||||||
this[ChapterTable.date_upload] = it.uploadDate
|
this[ChapterTable.name] = it.name
|
||||||
this[ChapterTable.chapter_number] = it.chapterNumber
|
this[ChapterTable.date_upload] = it.uploadDate
|
||||||
this[ChapterTable.scanlator] = it.scanlator
|
this[ChapterTable.chapter_number] = it.chapterNumber
|
||||||
this[ChapterTable.sourceOrder] = it.index
|
this[ChapterTable.scanlator] = it.scanlator
|
||||||
this[ChapterTable.realUrl] = it.realUrl
|
this[ChapterTable.sourceOrder] = it.index
|
||||||
}
|
this[ChapterTable.realUrl] = it.realUrl
|
||||||
execute(this@transaction)
|
}
|
||||||
}
|
}.toExecutable()
|
||||||
|
.execute(this@transaction)
|
||||||
}
|
}
|
||||||
|
|
||||||
MangaTable.update({ MangaTable.id eq mangaId }) {
|
MangaTable.update({ MangaTable.id eq mangaId }) {
|
||||||
@@ -517,11 +522,11 @@ object Chapter {
|
|||||||
// mangaId is not null, scope query under manga
|
// mangaId is not null, scope query under manga
|
||||||
when {
|
when {
|
||||||
input.chapterIds != null -> {
|
input.chapterIds != null -> {
|
||||||
Op.build { (ChapterTable.manga eq mangaId) and (ChapterTable.id inList input.chapterIds) }
|
(ChapterTable.manga eq mangaId) and (ChapterTable.id inList input.chapterIds)
|
||||||
}
|
}
|
||||||
|
|
||||||
input.chapterIndexes != null -> {
|
input.chapterIndexes != null -> {
|
||||||
Op.build { (ChapterTable.manga eq mangaId) and (ChapterTable.sourceOrder inList input.chapterIndexes) }
|
(ChapterTable.manga eq mangaId) and (ChapterTable.sourceOrder inList input.chapterIndexes)
|
||||||
}
|
}
|
||||||
|
|
||||||
else -> {
|
else -> {
|
||||||
@@ -534,7 +539,7 @@ object Chapter {
|
|||||||
// mangaId is null, only chapterIndexes is valid for this case
|
// mangaId is null, only chapterIndexes is valid for this case
|
||||||
when {
|
when {
|
||||||
input.chapterIds != null -> {
|
input.chapterIds != null -> {
|
||||||
Op.build { (ChapterTable.id inList input.chapterIds) }
|
(ChapterTable.id inList input.chapterIds)
|
||||||
}
|
}
|
||||||
|
|
||||||
else -> {
|
else -> {
|
||||||
@@ -650,13 +655,14 @@ object Chapter {
|
|||||||
}
|
}
|
||||||
|
|
||||||
if (existingMetaByMetaId.isNotEmpty()) {
|
if (existingMetaByMetaId.isNotEmpty()) {
|
||||||
BatchUpdateStatement(ChapterMetaTable).apply {
|
BatchUpdateStatement(ChapterMetaTable)
|
||||||
existingMetaByMetaId.forEach { (metaId, entry) ->
|
.apply {
|
||||||
addBatch(EntityID(metaId, ChapterMetaTable))
|
existingMetaByMetaId.forEach { (metaId, entry) ->
|
||||||
this[ChapterMetaTable.value] = entry.value
|
addBatch(EntityID(metaId, ChapterMetaTable))
|
||||||
}
|
this[ChapterMetaTable.value] = entry.value
|
||||||
execute(this@transaction)
|
}
|
||||||
}
|
}.toExecutable()
|
||||||
|
.execute(this@transaction)
|
||||||
}
|
}
|
||||||
|
|
||||||
if (newMetaByChapterId.isNotEmpty()) {
|
if (newMetaByChapterId.isNotEmpty()) {
|
||||||
|
|||||||
@@ -1,7 +1,9 @@
|
|||||||
package suwayomi.tachidesk.manga.impl
|
package suwayomi.tachidesk.manga.impl
|
||||||
|
|
||||||
import kotlinx.coroutines.CoroutineScope
|
import kotlinx.coroutines.CoroutineScope
|
||||||
import org.jetbrains.exposed.sql.transactions.transaction
|
import org.jetbrains.exposed.v1.core.eq
|
||||||
|
import org.jetbrains.exposed.v1.jdbc.select
|
||||||
|
import org.jetbrains.exposed.v1.jdbc.transactions.transaction
|
||||||
import suwayomi.tachidesk.manga.impl.chapter.getChapterDownloadReady
|
import suwayomi.tachidesk.manga.impl.chapter.getChapterDownloadReady
|
||||||
import suwayomi.tachidesk.manga.impl.download.fileProvider.ChaptersFilesProvider
|
import suwayomi.tachidesk.manga.impl.download.fileProvider.ChaptersFilesProvider
|
||||||
import suwayomi.tachidesk.manga.impl.download.fileProvider.impl.ArchiveProvider
|
import suwayomi.tachidesk.manga.impl.download.fileProvider.impl.ArchiveProvider
|
||||||
|
|||||||
@@ -12,11 +12,14 @@ import kotlinx.coroutines.CoroutineScope
|
|||||||
import kotlinx.coroutines.Dispatchers
|
import kotlinx.coroutines.Dispatchers
|
||||||
import kotlinx.coroutines.SupervisorJob
|
import kotlinx.coroutines.SupervisorJob
|
||||||
import kotlinx.coroutines.launch
|
import kotlinx.coroutines.launch
|
||||||
import org.jetbrains.exposed.sql.and
|
import org.jetbrains.exposed.v1.core.and
|
||||||
import org.jetbrains.exposed.sql.insert
|
import org.jetbrains.exposed.v1.core.eq
|
||||||
import org.jetbrains.exposed.sql.selectAll
|
import org.jetbrains.exposed.v1.core.neq
|
||||||
import org.jetbrains.exposed.sql.transactions.transaction
|
import org.jetbrains.exposed.v1.jdbc.insert
|
||||||
import org.jetbrains.exposed.sql.update
|
import org.jetbrains.exposed.v1.jdbc.select
|
||||||
|
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.manga.impl.Manga.getManga
|
import suwayomi.tachidesk.manga.impl.Manga.getManga
|
||||||
import suwayomi.tachidesk.manga.model.table.CategoryMangaTable
|
import suwayomi.tachidesk.manga.model.table.CategoryMangaTable
|
||||||
import suwayomi.tachidesk.manga.model.table.CategoryTable
|
import suwayomi.tachidesk.manga.model.table.CategoryTable
|
||||||
|
|||||||
@@ -20,15 +20,18 @@ import io.github.oshai.kotlinlogging.KotlinLogging
|
|||||||
import io.javalin.http.HttpStatus
|
import io.javalin.http.HttpStatus
|
||||||
import okhttp3.CacheControl
|
import okhttp3.CacheControl
|
||||||
import okhttp3.Response
|
import okhttp3.Response
|
||||||
import org.jetbrains.exposed.dao.id.EntityID
|
import org.jetbrains.exposed.v1.core.ResultRow
|
||||||
import org.jetbrains.exposed.sql.ResultRow
|
import org.jetbrains.exposed.v1.core.SortOrder
|
||||||
import org.jetbrains.exposed.sql.SortOrder
|
import org.jetbrains.exposed.v1.core.and
|
||||||
import org.jetbrains.exposed.sql.and
|
import org.jetbrains.exposed.v1.core.dao.id.EntityID
|
||||||
import org.jetbrains.exposed.sql.batchInsert
|
import org.jetbrains.exposed.v1.core.eq
|
||||||
import org.jetbrains.exposed.sql.selectAll
|
import org.jetbrains.exposed.v1.core.inList
|
||||||
import org.jetbrains.exposed.sql.statements.BatchUpdateStatement
|
import org.jetbrains.exposed.v1.core.statements.BatchUpdateStatement
|
||||||
import org.jetbrains.exposed.sql.transactions.transaction
|
import org.jetbrains.exposed.v1.jdbc.batchInsert
|
||||||
import org.jetbrains.exposed.sql.update
|
import org.jetbrains.exposed.v1.jdbc.selectAll
|
||||||
|
import org.jetbrains.exposed.v1.jdbc.statements.toExecutable
|
||||||
|
import org.jetbrains.exposed.v1.jdbc.transactions.transaction
|
||||||
|
import org.jetbrains.exposed.v1.jdbc.update
|
||||||
import suwayomi.tachidesk.manga.impl.MangaList.proxyThumbnailUrl
|
import suwayomi.tachidesk.manga.impl.MangaList.proxyThumbnailUrl
|
||||||
import suwayomi.tachidesk.manga.impl.Source.getSource
|
import suwayomi.tachidesk.manga.impl.Source.getSource
|
||||||
import suwayomi.tachidesk.manga.impl.download.fileProvider.impl.MissingThumbnailException
|
import suwayomi.tachidesk.manga.impl.download.fileProvider.impl.MissingThumbnailException
|
||||||
@@ -295,13 +298,14 @@ object Manga {
|
|||||||
}
|
}
|
||||||
|
|
||||||
if (existingMetaByMetaId.isNotEmpty()) {
|
if (existingMetaByMetaId.isNotEmpty()) {
|
||||||
BatchUpdateStatement(MangaMetaTable).apply {
|
BatchUpdateStatement(MangaMetaTable)
|
||||||
existingMetaByMetaId.forEach { (metaId, entry) ->
|
.apply {
|
||||||
addBatch(EntityID(metaId, MangaMetaTable))
|
existingMetaByMetaId.forEach { (metaId, entry) ->
|
||||||
this[MangaMetaTable.value] = entry.value
|
addBatch(EntityID(metaId, MangaMetaTable))
|
||||||
}
|
this[MangaMetaTable.value] = entry.value
|
||||||
execute(this@transaction)
|
}
|
||||||
}
|
}.toExecutable()
|
||||||
|
.execute(this@transaction)
|
||||||
}
|
}
|
||||||
|
|
||||||
if (newMetaByMangaId.isNotEmpty()) {
|
if (newMetaByMangaId.isNotEmpty()) {
|
||||||
|
|||||||
@@ -9,12 +9,15 @@ package suwayomi.tachidesk.manga.impl
|
|||||||
|
|
||||||
import eu.kanade.tachiyomi.source.local.LocalSource
|
import eu.kanade.tachiyomi.source.local.LocalSource
|
||||||
import eu.kanade.tachiyomi.source.model.MangasPage
|
import eu.kanade.tachiyomi.source.model.MangasPage
|
||||||
import org.jetbrains.exposed.dao.id.EntityID
|
import org.jetbrains.exposed.v1.core.and
|
||||||
import org.jetbrains.exposed.sql.and
|
import org.jetbrains.exposed.v1.core.dao.id.EntityID
|
||||||
import org.jetbrains.exposed.sql.batchInsert
|
import org.jetbrains.exposed.v1.core.eq
|
||||||
import org.jetbrains.exposed.sql.selectAll
|
import org.jetbrains.exposed.v1.core.inList
|
||||||
import org.jetbrains.exposed.sql.statements.BatchUpdateStatement
|
import org.jetbrains.exposed.v1.core.statements.BatchUpdateStatement
|
||||||
import org.jetbrains.exposed.sql.transactions.transaction
|
import org.jetbrains.exposed.v1.jdbc.batchInsert
|
||||||
|
import org.jetbrains.exposed.v1.jdbc.selectAll
|
||||||
|
import org.jetbrains.exposed.v1.jdbc.statements.toExecutable
|
||||||
|
import org.jetbrains.exposed.v1.jdbc.transactions.transaction
|
||||||
import suwayomi.tachidesk.manga.impl.util.source.GetCatalogueSource.getCatalogueSourceOrStub
|
import suwayomi.tachidesk.manga.impl.util.source.GetCatalogueSource.getCatalogueSourceOrStub
|
||||||
import suwayomi.tachidesk.manga.model.dataclass.PagedMangaListDataClass
|
import suwayomi.tachidesk.manga.model.dataclass.PagedMangaListDataClass
|
||||||
import suwayomi.tachidesk.manga.model.table.MangaTable
|
import suwayomi.tachidesk.manga.model.table.MangaTable
|
||||||
@@ -88,27 +91,28 @@ object MangaList {
|
|||||||
}
|
}
|
||||||
|
|
||||||
if (mangaToUpdate.isNotEmpty()) {
|
if (mangaToUpdate.isNotEmpty()) {
|
||||||
BatchUpdateStatement(MangaTable).apply {
|
BatchUpdateStatement(MangaTable)
|
||||||
mangaToUpdate.forEach { (sManga, manga) ->
|
.apply {
|
||||||
addBatch(EntityID(manga[MangaTable.id].value, MangaTable))
|
mangaToUpdate.forEach { (sManga, manga) ->
|
||||||
this[MangaTable.title] = sManga.title
|
addBatch(EntityID(manga[MangaTable.id].value, MangaTable))
|
||||||
this[MangaTable.artist] = sManga.artist ?: manga[MangaTable.artist]
|
this[MangaTable.title] = sManga.title
|
||||||
this[MangaTable.author] = sManga.author ?: manga[MangaTable.author]
|
this[MangaTable.artist] = sManga.artist ?: manga[MangaTable.artist]
|
||||||
this[MangaTable.description] = sManga.description ?: manga[MangaTable.description]
|
this[MangaTable.author] = sManga.author ?: manga[MangaTable.author]
|
||||||
this[MangaTable.genre] = sManga.genre ?: manga[MangaTable.genre]
|
this[MangaTable.description] = sManga.description ?: manga[MangaTable.description]
|
||||||
this[MangaTable.status] = sManga.status
|
this[MangaTable.genre] = sManga.genre ?: manga[MangaTable.genre]
|
||||||
this[MangaTable.thumbnail_url] = sManga.thumbnail_url ?: manga[MangaTable.thumbnail_url]
|
this[MangaTable.status] = sManga.status
|
||||||
this[MangaTable.updateStrategy] = sManga.update_strategy.name
|
this[MangaTable.thumbnail_url] = sManga.thumbnail_url ?: manga[MangaTable.thumbnail_url]
|
||||||
if (!sManga.thumbnail_url.isNullOrEmpty() && manga[MangaTable.thumbnail_url] != sManga.thumbnail_url) {
|
this[MangaTable.updateStrategy] = sManga.update_strategy.name
|
||||||
this[MangaTable.thumbnailUrlLastFetched] = Instant.now().epochSecond
|
if (!sManga.thumbnail_url.isNullOrEmpty() && manga[MangaTable.thumbnail_url] != sManga.thumbnail_url) {
|
||||||
Manga.clearThumbnail(manga[MangaTable.id].value)
|
this[MangaTable.thumbnailUrlLastFetched] = Instant.now().epochSecond
|
||||||
} else {
|
Manga.clearThumbnail(manga[MangaTable.id].value)
|
||||||
this[MangaTable.thumbnailUrlLastFetched] =
|
} else {
|
||||||
manga[MangaTable.thumbnailUrlLastFetched]
|
this[MangaTable.thumbnailUrlLastFetched] =
|
||||||
|
manga[MangaTable.thumbnailUrlLastFetched]
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}.toExecutable()
|
||||||
execute(this@transaction)
|
.execute(this@transaction)
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
val mangaUrlsToId =
|
val mangaUrlsToId =
|
||||||
|
|||||||
@@ -13,11 +13,12 @@ import eu.kanade.tachiyomi.source.online.HttpSource
|
|||||||
import io.github.oshai.kotlinlogging.KotlinLogging
|
import io.github.oshai.kotlinlogging.KotlinLogging
|
||||||
import kotlinx.coroutines.flow.StateFlow
|
import kotlinx.coroutines.flow.StateFlow
|
||||||
import libcore.net.MimeUtils
|
import libcore.net.MimeUtils
|
||||||
import org.jetbrains.exposed.sql.SortOrder
|
import org.jetbrains.exposed.v1.core.SortOrder
|
||||||
import org.jetbrains.exposed.sql.and
|
import org.jetbrains.exposed.v1.core.and
|
||||||
import org.jetbrains.exposed.sql.selectAll
|
import org.jetbrains.exposed.v1.core.eq
|
||||||
import org.jetbrains.exposed.sql.transactions.transaction
|
import org.jetbrains.exposed.v1.jdbc.selectAll
|
||||||
import org.jetbrains.exposed.sql.update
|
import org.jetbrains.exposed.v1.jdbc.transactions.transaction
|
||||||
|
import org.jetbrains.exposed.v1.jdbc.update
|
||||||
import suwayomi.tachidesk.graphql.types.DownloadConversion
|
import suwayomi.tachidesk.graphql.types.DownloadConversion
|
||||||
import suwayomi.tachidesk.manga.impl.util.getChapterCachePath
|
import suwayomi.tachidesk.manga.impl.util.getChapterCachePath
|
||||||
import suwayomi.tachidesk.manga.impl.util.source.GetCatalogueSource.getCatalogueSourceOrStub
|
import suwayomi.tachidesk.manga.impl.util.source.GetCatalogueSource.getCatalogueSourceOrStub
|
||||||
|
|||||||
@@ -15,12 +15,16 @@ import eu.kanade.tachiyomi.source.sourcePreferences
|
|||||||
import io.github.oshai.kotlinlogging.KotlinLogging
|
import io.github.oshai.kotlinlogging.KotlinLogging
|
||||||
import io.javalin.json.JsonMapper
|
import io.javalin.json.JsonMapper
|
||||||
import io.javalin.json.fromJsonString
|
import io.javalin.json.fromJsonString
|
||||||
import org.jetbrains.exposed.dao.id.EntityID
|
import org.jetbrains.exposed.v1.core.and
|
||||||
import org.jetbrains.exposed.sql.and
|
import org.jetbrains.exposed.v1.core.dao.id.EntityID
|
||||||
import org.jetbrains.exposed.sql.batchInsert
|
import org.jetbrains.exposed.v1.core.eq
|
||||||
import org.jetbrains.exposed.sql.selectAll
|
import org.jetbrains.exposed.v1.core.inList
|
||||||
import org.jetbrains.exposed.sql.statements.BatchUpdateStatement
|
import org.jetbrains.exposed.v1.core.statements.BatchUpdateStatement
|
||||||
import org.jetbrains.exposed.sql.transactions.transaction
|
import org.jetbrains.exposed.v1.jdbc.batchInsert
|
||||||
|
import org.jetbrains.exposed.v1.jdbc.selectAll
|
||||||
|
import org.jetbrains.exposed.v1.jdbc.statements.toExecutable
|
||||||
|
import org.jetbrains.exposed.v1.jdbc.transactions.transaction
|
||||||
|
import suwayomi.tachidesk.manga.impl.Source.preferenceScreenMap
|
||||||
import suwayomi.tachidesk.manga.impl.extension.Extension.getExtensionIconUrl
|
import suwayomi.tachidesk.manga.impl.extension.Extension.getExtensionIconUrl
|
||||||
import suwayomi.tachidesk.manga.impl.util.source.GetCatalogueSource.getCatalogueSourceOrNull
|
import suwayomi.tachidesk.manga.impl.util.source.GetCatalogueSource.getCatalogueSourceOrNull
|
||||||
import suwayomi.tachidesk.manga.impl.util.source.GetCatalogueSource.getCatalogueSourceOrStub
|
import suwayomi.tachidesk.manga.impl.util.source.GetCatalogueSource.getCatalogueSourceOrStub
|
||||||
@@ -210,13 +214,14 @@ object Source {
|
|||||||
}
|
}
|
||||||
|
|
||||||
if (existingMetaByMetaId.isNotEmpty()) {
|
if (existingMetaByMetaId.isNotEmpty()) {
|
||||||
BatchUpdateStatement(SourceMetaTable).apply {
|
BatchUpdateStatement(SourceMetaTable)
|
||||||
existingMetaByMetaId.forEach { (metaId, entry) ->
|
.apply {
|
||||||
addBatch(EntityID(metaId, SourceMetaTable))
|
existingMetaByMetaId.forEach { (metaId, entry) ->
|
||||||
this[SourceMetaTable.value] = entry.value
|
addBatch(EntityID(metaId, SourceMetaTable))
|
||||||
}
|
this[SourceMetaTable.value] = entry.value
|
||||||
execute(this@transaction)
|
}
|
||||||
}
|
}.toExecutable()
|
||||||
|
.execute(this@transaction)
|
||||||
}
|
}
|
||||||
|
|
||||||
if (newMetaBySourceId.isNotEmpty()) {
|
if (newMetaBySourceId.isNotEmpty()) {
|
||||||
|
|||||||
@@ -19,7 +19,7 @@ import okio.Buffer
|
|||||||
import okio.Sink
|
import okio.Sink
|
||||||
import okio.buffer
|
import okio.buffer
|
||||||
import okio.gzip
|
import okio.gzip
|
||||||
import org.jetbrains.exposed.sql.transactions.transaction
|
import org.jetbrains.exposed.v1.jdbc.transactions.transaction
|
||||||
import suwayomi.tachidesk.manga.impl.backup.BackupFlags
|
import suwayomi.tachidesk.manga.impl.backup.BackupFlags
|
||||||
import suwayomi.tachidesk.manga.impl.backup.proto.handlers.BackupCategoryHandler
|
import suwayomi.tachidesk.manga.impl.backup.proto.handlers.BackupCategoryHandler
|
||||||
import suwayomi.tachidesk.manga.impl.backup.proto.handlers.BackupGlobalMetaHandler
|
import suwayomi.tachidesk.manga.impl.backup.proto.handlers.BackupGlobalMetaHandler
|
||||||
|
|||||||
@@ -11,8 +11,9 @@ import com.fasterxml.jackson.annotation.JsonIgnore
|
|||||||
import okio.buffer
|
import okio.buffer
|
||||||
import okio.gzip
|
import okio.gzip
|
||||||
import okio.source
|
import okio.source
|
||||||
import org.jetbrains.exposed.sql.selectAll
|
import org.jetbrains.exposed.v1.core.eq
|
||||||
import org.jetbrains.exposed.sql.transactions.transaction
|
import org.jetbrains.exposed.v1.jdbc.selectAll
|
||||||
|
import org.jetbrains.exposed.v1.jdbc.transactions.transaction
|
||||||
import suwayomi.tachidesk.manga.impl.backup.proto.models.Backup
|
import suwayomi.tachidesk.manga.impl.backup.proto.models.Backup
|
||||||
import suwayomi.tachidesk.manga.impl.track.tracker.TrackerManager
|
import suwayomi.tachidesk.manga.impl.track.tracker.TrackerManager
|
||||||
import suwayomi.tachidesk.manga.model.table.SourceTable
|
import suwayomi.tachidesk.manga.model.table.SourceTable
|
||||||
|
|||||||
@@ -7,8 +7,8 @@ package suwayomi.tachidesk.manga.impl.backup.proto.handlers
|
|||||||
* License, v. 2.0. If a copy of the MPL was not distributed with this
|
* 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/. */
|
* file, You can obtain one at https://mozilla.org/MPL/2.0/. */
|
||||||
|
|
||||||
import org.jetbrains.exposed.sql.SortOrder
|
import org.jetbrains.exposed.v1.core.SortOrder
|
||||||
import org.jetbrains.exposed.sql.selectAll
|
import org.jetbrains.exposed.v1.jdbc.selectAll
|
||||||
import suwayomi.tachidesk.manga.impl.Category
|
import suwayomi.tachidesk.manga.impl.Category
|
||||||
import suwayomi.tachidesk.manga.impl.Category.modifyCategoriesMetas
|
import suwayomi.tachidesk.manga.impl.Category.modifyCategoriesMetas
|
||||||
import suwayomi.tachidesk.manga.impl.backup.BackupFlags
|
import suwayomi.tachidesk.manga.impl.backup.BackupFlags
|
||||||
|
|||||||
@@ -8,16 +8,18 @@ package suwayomi.tachidesk.manga.impl.backup.proto.handlers
|
|||||||
* file, You can obtain one at https://mozilla.org/MPL/2.0/. */
|
* file, You can obtain one at https://mozilla.org/MPL/2.0/. */
|
||||||
|
|
||||||
import eu.kanade.tachiyomi.source.model.UpdateStrategy
|
import eu.kanade.tachiyomi.source.model.UpdateStrategy
|
||||||
import org.jetbrains.exposed.dao.id.EntityID
|
import org.jetbrains.exposed.v1.core.ResultRow
|
||||||
import org.jetbrains.exposed.sql.ResultRow
|
import org.jetbrains.exposed.v1.core.SortOrder
|
||||||
import org.jetbrains.exposed.sql.SortOrder
|
import org.jetbrains.exposed.v1.core.and
|
||||||
import org.jetbrains.exposed.sql.and
|
import org.jetbrains.exposed.v1.core.dao.id.EntityID
|
||||||
import org.jetbrains.exposed.sql.batchInsert
|
import org.jetbrains.exposed.v1.core.eq
|
||||||
import org.jetbrains.exposed.sql.insertAndGetId
|
import org.jetbrains.exposed.v1.core.statements.BatchUpdateStatement
|
||||||
import org.jetbrains.exposed.sql.selectAll
|
import org.jetbrains.exposed.v1.jdbc.batchInsert
|
||||||
import org.jetbrains.exposed.sql.statements.BatchUpdateStatement
|
import org.jetbrains.exposed.v1.jdbc.insertAndGetId
|
||||||
import org.jetbrains.exposed.sql.transactions.transaction
|
import org.jetbrains.exposed.v1.jdbc.selectAll
|
||||||
import org.jetbrains.exposed.sql.update
|
import org.jetbrains.exposed.v1.jdbc.statements.toExecutable
|
||||||
|
import org.jetbrains.exposed.v1.jdbc.transactions.transaction
|
||||||
|
import org.jetbrains.exposed.v1.jdbc.update
|
||||||
import suwayomi.tachidesk.manga.impl.CategoryManga
|
import suwayomi.tachidesk.manga.impl.CategoryManga
|
||||||
import suwayomi.tachidesk.manga.impl.Chapter
|
import suwayomi.tachidesk.manga.impl.Chapter
|
||||||
import suwayomi.tachidesk.manga.impl.Chapter.modifyChaptersMetas
|
import suwayomi.tachidesk.manga.impl.Chapter.modifyChaptersMetas
|
||||||
@@ -343,24 +345,25 @@ object BackupMangaHandler {
|
|||||||
}
|
}
|
||||||
|
|
||||||
if (chaptersToUpdateToDbChapter.isNotEmpty()) {
|
if (chaptersToUpdateToDbChapter.isNotEmpty()) {
|
||||||
BatchUpdateStatement(ChapterTable).apply {
|
BatchUpdateStatement(ChapterTable)
|
||||||
chaptersToUpdateToDbChapter.forEach { (backupChapter, dbChapter) ->
|
.apply {
|
||||||
addBatch(EntityID(dbChapter[ChapterTable.id].value, ChapterTable))
|
chaptersToUpdateToDbChapter.forEach { (backupChapter, dbChapter) ->
|
||||||
if (flags.includeChapters) {
|
addBatch(EntityID(dbChapter[ChapterTable.id].value, ChapterTable))
|
||||||
this[ChapterTable.isRead] = backupChapter.read || dbChapter[ChapterTable.isRead]
|
if (flags.includeChapters) {
|
||||||
this[ChapterTable.lastPageRead] =
|
this[ChapterTable.isRead] = backupChapter.read || dbChapter[ChapterTable.isRead]
|
||||||
max(backupChapter.lastPageRead, dbChapter[ChapterTable.lastPageRead]).coerceAtLeast(0)
|
this[ChapterTable.lastPageRead] =
|
||||||
this[ChapterTable.isBookmarked] = backupChapter.bookmark || dbChapter[ChapterTable.isBookmarked]
|
max(backupChapter.lastPageRead, dbChapter[ChapterTable.lastPageRead]).coerceAtLeast(0)
|
||||||
}
|
this[ChapterTable.isBookmarked] = backupChapter.bookmark || dbChapter[ChapterTable.isBookmarked]
|
||||||
|
}
|
||||||
|
|
||||||
if (flags.includeHistory) {
|
if (flags.includeHistory) {
|
||||||
this[ChapterTable.lastReadAt] =
|
this[ChapterTable.lastReadAt] =
|
||||||
(historyByChapter[backupChapter.url]?.maxOrNull()?.milliseconds?.inWholeSeconds ?: 0)
|
(historyByChapter[backupChapter.url]?.maxOrNull()?.milliseconds?.inWholeSeconds ?: 0)
|
||||||
.coerceAtLeast(dbChapter[ChapterTable.lastReadAt])
|
.coerceAtLeast(dbChapter[ChapterTable.lastReadAt])
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}.toExecutable()
|
||||||
execute(this@dbTransaction)
|
.execute(this@dbTransaction)
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
if (flags.includeClientData) {
|
if (flags.includeClientData) {
|
||||||
|
|||||||
@@ -7,7 +7,8 @@ package suwayomi.tachidesk.manga.impl.backup.proto.handlers
|
|||||||
* License, v. 2.0. If a copy of the MPL was not distributed with this
|
* 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/. */
|
* file, You can obtain one at https://mozilla.org/MPL/2.0/. */
|
||||||
|
|
||||||
import org.jetbrains.exposed.sql.selectAll
|
import org.jetbrains.exposed.v1.core.inList
|
||||||
|
import org.jetbrains.exposed.v1.jdbc.selectAll
|
||||||
import suwayomi.tachidesk.manga.impl.Source
|
import suwayomi.tachidesk.manga.impl.Source
|
||||||
import suwayomi.tachidesk.manga.impl.Source.modifySourceMetas
|
import suwayomi.tachidesk.manga.impl.Source.modifySourceMetas
|
||||||
import suwayomi.tachidesk.manga.impl.backup.BackupFlags
|
import suwayomi.tachidesk.manga.impl.backup.BackupFlags
|
||||||
|
|||||||
@@ -14,14 +14,14 @@ import io.github.oshai.kotlinlogging.KotlinLogging
|
|||||||
import io.github.reactivecircus.cache4k.Cache
|
import io.github.reactivecircus.cache4k.Cache
|
||||||
import kotlinx.coroutines.sync.Mutex
|
import kotlinx.coroutines.sync.Mutex
|
||||||
import kotlinx.coroutines.sync.withLock
|
import kotlinx.coroutines.sync.withLock
|
||||||
import org.jetbrains.exposed.sql.ResultRow
|
import org.jetbrains.exposed.v1.core.ResultRow
|
||||||
import org.jetbrains.exposed.sql.SqlExpressionBuilder.eq
|
import org.jetbrains.exposed.v1.core.and
|
||||||
import org.jetbrains.exposed.sql.and
|
import org.jetbrains.exposed.v1.core.eq
|
||||||
import org.jetbrains.exposed.sql.batchInsert
|
import org.jetbrains.exposed.v1.jdbc.batchInsert
|
||||||
import org.jetbrains.exposed.sql.deleteWhere
|
import org.jetbrains.exposed.v1.jdbc.deleteWhere
|
||||||
import org.jetbrains.exposed.sql.selectAll
|
import org.jetbrains.exposed.v1.jdbc.selectAll
|
||||||
import org.jetbrains.exposed.sql.transactions.transaction
|
import org.jetbrains.exposed.v1.jdbc.transactions.transaction
|
||||||
import org.jetbrains.exposed.sql.update
|
import org.jetbrains.exposed.v1.jdbc.update
|
||||||
import suwayomi.tachidesk.manga.impl.ChapterDownloadHelper
|
import suwayomi.tachidesk.manga.impl.ChapterDownloadHelper
|
||||||
import suwayomi.tachidesk.manga.impl.util.source.GetCatalogueSource.getCatalogueSourceOrStub
|
import suwayomi.tachidesk.manga.impl.util.source.GetCatalogueSource.getCatalogueSourceOrStub
|
||||||
import suwayomi.tachidesk.manga.model.dataclass.ChapterDataClass
|
import suwayomi.tachidesk.manga.model.dataclass.ChapterDataClass
|
||||||
|
|||||||
@@ -27,9 +27,12 @@ import kotlinx.coroutines.flow.onStart
|
|||||||
import kotlinx.coroutines.flow.sample
|
import kotlinx.coroutines.flow.sample
|
||||||
import kotlinx.coroutines.launch
|
import kotlinx.coroutines.launch
|
||||||
import kotlinx.serialization.Serializable
|
import kotlinx.serialization.Serializable
|
||||||
import org.jetbrains.exposed.sql.and
|
import org.jetbrains.exposed.v1.core.and
|
||||||
import org.jetbrains.exposed.sql.selectAll
|
import org.jetbrains.exposed.v1.core.eq
|
||||||
import org.jetbrains.exposed.sql.transactions.transaction
|
import org.jetbrains.exposed.v1.core.inList
|
||||||
|
import org.jetbrains.exposed.v1.jdbc.select
|
||||||
|
import org.jetbrains.exposed.v1.jdbc.selectAll
|
||||||
|
import org.jetbrains.exposed.v1.jdbc.transactions.transaction
|
||||||
import suwayomi.tachidesk.manga.impl.download.model.DownloadChapter
|
import suwayomi.tachidesk.manga.impl.download.model.DownloadChapter
|
||||||
import suwayomi.tachidesk.manga.impl.download.model.DownloadQueueItem
|
import suwayomi.tachidesk.manga.impl.download.model.DownloadQueueItem
|
||||||
import suwayomi.tachidesk.manga.impl.download.model.DownloadState.Error
|
import suwayomi.tachidesk.manga.impl.download.model.DownloadState.Error
|
||||||
@@ -343,7 +346,7 @@ object DownloadManager {
|
|||||||
transaction {
|
transaction {
|
||||||
ChapterTable
|
ChapterTable
|
||||||
.select(ChapterTable.id)
|
.select(ChapterTable.id)
|
||||||
.where { ChapterTable.manga.eq(mangaId) and ChapterTable.sourceOrder.eq(chapterIndex) }
|
.where { (ChapterTable.manga eq mangaId) and (ChapterTable.sourceOrder eq chapterIndex) }
|
||||||
.first()
|
.first()
|
||||||
}
|
}
|
||||||
enqueue(EnqueueInput(chapterIds = listOf(chapter[ChapterTable.id].value)))
|
enqueue(EnqueueInput(chapterIds = listOf(chapter[ChapterTable.id].value)))
|
||||||
|
|||||||
@@ -17,8 +17,9 @@ import kotlinx.coroutines.currentCoroutineContext
|
|||||||
import kotlinx.coroutines.ensureActive
|
import kotlinx.coroutines.ensureActive
|
||||||
import kotlinx.coroutines.isActive
|
import kotlinx.coroutines.isActive
|
||||||
import kotlinx.coroutines.launch
|
import kotlinx.coroutines.launch
|
||||||
import org.jetbrains.exposed.sql.transactions.transaction
|
import org.jetbrains.exposed.v1.core.eq
|
||||||
import org.jetbrains.exposed.sql.update
|
import org.jetbrains.exposed.v1.jdbc.transactions.transaction
|
||||||
|
import org.jetbrains.exposed.v1.jdbc.update
|
||||||
import suwayomi.tachidesk.manga.impl.ChapterDownloadHelper
|
import suwayomi.tachidesk.manga.impl.ChapterDownloadHelper
|
||||||
import suwayomi.tachidesk.manga.impl.chapter.getChapterDownloadReadyById
|
import suwayomi.tachidesk.manga.impl.chapter.getChapterDownloadReadyById
|
||||||
import suwayomi.tachidesk.manga.impl.download.model.DownloadQueueItem
|
import suwayomi.tachidesk.manga.impl.download.model.DownloadQueueItem
|
||||||
|
|||||||
@@ -11,10 +11,10 @@ import kotlinx.coroutines.flow.onEach
|
|||||||
import kotlinx.coroutines.flow.sample
|
import kotlinx.coroutines.flow.sample
|
||||||
import libcore.net.MimeUtils
|
import libcore.net.MimeUtils
|
||||||
import org.apache.commons.compress.archivers.zip.ZipArchiveEntry
|
import org.apache.commons.compress.archivers.zip.ZipArchiveEntry
|
||||||
import org.jetbrains.exposed.sql.selectAll
|
import org.jetbrains.exposed.v1.core.eq
|
||||||
import org.jetbrains.exposed.sql.transactions.transaction
|
import org.jetbrains.exposed.v1.jdbc.selectAll
|
||||||
import org.jetbrains.exposed.sql.update
|
import org.jetbrains.exposed.v1.jdbc.transactions.transaction
|
||||||
import suwayomi.tachidesk.graphql.types.DownloadConversion
|
import org.jetbrains.exposed.v1.jdbc.update
|
||||||
import suwayomi.tachidesk.manga.impl.Page
|
import suwayomi.tachidesk.manga.impl.Page
|
||||||
import suwayomi.tachidesk.manga.impl.chapter.getChapterDownloadReady
|
import suwayomi.tachidesk.manga.impl.chapter.getChapterDownloadReady
|
||||||
import suwayomi.tachidesk.manga.impl.download.model.DownloadQueueItem
|
import suwayomi.tachidesk.manga.impl.download.model.DownloadQueueItem
|
||||||
@@ -26,14 +26,8 @@ import suwayomi.tachidesk.manga.impl.util.getChapterDownloadPath
|
|||||||
import suwayomi.tachidesk.manga.impl.util.storage.ImageResponse
|
import suwayomi.tachidesk.manga.impl.util.storage.ImageResponse
|
||||||
import suwayomi.tachidesk.manga.model.table.ChapterTable
|
import suwayomi.tachidesk.manga.model.table.ChapterTable
|
||||||
import suwayomi.tachidesk.manga.model.table.MangaTable
|
import suwayomi.tachidesk.manga.model.table.MangaTable
|
||||||
import suwayomi.tachidesk.server.serverConfig
|
|
||||||
import suwayomi.tachidesk.util.ConversionUtil
|
|
||||||
import java.io.File
|
import java.io.File
|
||||||
import java.io.InputStream
|
import java.io.InputStream
|
||||||
import javax.imageio.IIOImage
|
|
||||||
import javax.imageio.ImageIO
|
|
||||||
import javax.imageio.ImageWriteParam
|
|
||||||
import javax.imageio.ImageWriter
|
|
||||||
|
|
||||||
sealed class FileType {
|
sealed class FileType {
|
||||||
data class RegularFile(
|
data class RegularFile(
|
||||||
|
|||||||
@@ -6,8 +6,9 @@ import org.apache.commons.compress.archivers.zip.ZipArchiveEntry
|
|||||||
import org.apache.commons.compress.archivers.zip.ZipArchiveInputStream
|
import org.apache.commons.compress.archivers.zip.ZipArchiveInputStream
|
||||||
import org.apache.commons.compress.archivers.zip.ZipArchiveOutputStream
|
import org.apache.commons.compress.archivers.zip.ZipArchiveOutputStream
|
||||||
import org.apache.commons.compress.archivers.zip.ZipFile
|
import org.apache.commons.compress.archivers.zip.ZipFile
|
||||||
import org.jetbrains.exposed.sql.transactions.transaction
|
import org.jetbrains.exposed.v1.core.eq
|
||||||
import org.jetbrains.exposed.sql.update
|
import org.jetbrains.exposed.v1.jdbc.transactions.transaction
|
||||||
|
import org.jetbrains.exposed.v1.jdbc.update
|
||||||
import suwayomi.tachidesk.manga.impl.download.fileProvider.ChaptersFilesProvider
|
import suwayomi.tachidesk.manga.impl.download.fileProvider.ChaptersFilesProvider
|
||||||
import suwayomi.tachidesk.manga.impl.download.fileProvider.FileType
|
import suwayomi.tachidesk.manga.impl.download.fileProvider.FileType
|
||||||
import suwayomi.tachidesk.manga.impl.util.getChapterCachePath
|
import suwayomi.tachidesk.manga.impl.util.getChapterCachePath
|
||||||
|
|||||||
@@ -2,8 +2,9 @@ package suwayomi.tachidesk.manga.impl.download.fileProvider.impl
|
|||||||
|
|
||||||
import org.apache.commons.compress.archivers.zip.ZipArchiveEntry
|
import org.apache.commons.compress.archivers.zip.ZipArchiveEntry
|
||||||
import org.apache.commons.compress.archivers.zip.ZipArchiveOutputStream
|
import org.apache.commons.compress.archivers.zip.ZipArchiveOutputStream
|
||||||
import org.jetbrains.exposed.sql.transactions.transaction
|
import org.jetbrains.exposed.v1.core.eq
|
||||||
import org.jetbrains.exposed.sql.update
|
import org.jetbrains.exposed.v1.jdbc.transactions.transaction
|
||||||
|
import org.jetbrains.exposed.v1.jdbc.update
|
||||||
import suwayomi.tachidesk.manga.impl.download.fileProvider.ChaptersFilesProvider
|
import suwayomi.tachidesk.manga.impl.download.fileProvider.ChaptersFilesProvider
|
||||||
import suwayomi.tachidesk.manga.impl.download.fileProvider.FileType.RegularFile
|
import suwayomi.tachidesk.manga.impl.download.fileProvider.FileType.RegularFile
|
||||||
import suwayomi.tachidesk.manga.impl.util.getChapterCachePath
|
import suwayomi.tachidesk.manga.impl.util.getChapterCachePath
|
||||||
|
|||||||
@@ -20,12 +20,12 @@ import okhttp3.CacheControl
|
|||||||
import okio.buffer
|
import okio.buffer
|
||||||
import okio.sink
|
import okio.sink
|
||||||
import okio.source
|
import okio.source
|
||||||
import org.jetbrains.exposed.sql.SqlExpressionBuilder.eq
|
import org.jetbrains.exposed.v1.core.eq
|
||||||
import org.jetbrains.exposed.sql.deleteWhere
|
import org.jetbrains.exposed.v1.jdbc.deleteWhere
|
||||||
import org.jetbrains.exposed.sql.insert
|
import org.jetbrains.exposed.v1.jdbc.insert
|
||||||
import org.jetbrains.exposed.sql.selectAll
|
import org.jetbrains.exposed.v1.jdbc.selectAll
|
||||||
import org.jetbrains.exposed.sql.transactions.transaction
|
import org.jetbrains.exposed.v1.jdbc.transactions.transaction
|
||||||
import org.jetbrains.exposed.sql.update
|
import org.jetbrains.exposed.v1.jdbc.update
|
||||||
import suwayomi.tachidesk.manga.impl.extension.ExtensionsList.extensionTableAsDataClass
|
import suwayomi.tachidesk.manga.impl.extension.ExtensionsList.extensionTableAsDataClass
|
||||||
import suwayomi.tachidesk.manga.impl.extension.github.ExtensionGithubApi
|
import suwayomi.tachidesk.manga.impl.extension.github.ExtensionGithubApi
|
||||||
import suwayomi.tachidesk.manga.impl.util.PackageTools
|
import suwayomi.tachidesk.manga.impl.util.PackageTools
|
||||||
@@ -55,7 +55,6 @@ import java.util.zip.ZipOutputStream
|
|||||||
import kotlin.io.path.Path
|
import kotlin.io.path.Path
|
||||||
import kotlin.io.path.absolutePathString
|
import kotlin.io.path.absolutePathString
|
||||||
import kotlin.io.path.outputStream
|
import kotlin.io.path.outputStream
|
||||||
import kotlin.io.path.relativeTo
|
|
||||||
|
|
||||||
object Extension {
|
object Extension {
|
||||||
private val logger = KotlinLogging.logger {}
|
private val logger = KotlinLogging.logger {}
|
||||||
|
|||||||
@@ -11,15 +11,16 @@ import eu.kanade.tachiyomi.source.local.LocalSource
|
|||||||
import io.github.oshai.kotlinlogging.KotlinLogging
|
import io.github.oshai.kotlinlogging.KotlinLogging
|
||||||
import kotlinx.coroutines.sync.Mutex
|
import kotlinx.coroutines.sync.Mutex
|
||||||
import kotlinx.coroutines.sync.withLock
|
import kotlinx.coroutines.sync.withLock
|
||||||
import org.jetbrains.exposed.dao.id.EntityID
|
import org.jetbrains.exposed.v1.core.ResultRow
|
||||||
import org.jetbrains.exposed.sql.ResultRow
|
import org.jetbrains.exposed.v1.core.dao.id.EntityID
|
||||||
import org.jetbrains.exposed.sql.SqlExpressionBuilder.inList
|
import org.jetbrains.exposed.v1.core.inList
|
||||||
import org.jetbrains.exposed.sql.batchInsert
|
import org.jetbrains.exposed.v1.core.statements.BatchUpdateStatement
|
||||||
import org.jetbrains.exposed.sql.deleteWhere
|
import org.jetbrains.exposed.v1.jdbc.batchInsert
|
||||||
import org.jetbrains.exposed.sql.selectAll
|
import org.jetbrains.exposed.v1.jdbc.deleteWhere
|
||||||
import org.jetbrains.exposed.sql.statements.BatchUpdateStatement
|
import org.jetbrains.exposed.v1.jdbc.selectAll
|
||||||
import org.jetbrains.exposed.sql.transactions.transaction
|
import org.jetbrains.exposed.v1.jdbc.statements.toExecutable
|
||||||
import org.jetbrains.exposed.sql.update
|
import org.jetbrains.exposed.v1.jdbc.transactions.transaction
|
||||||
|
import org.jetbrains.exposed.v1.jdbc.update
|
||||||
import suwayomi.tachidesk.manga.impl.extension.Extension.getExtensionIconUrl
|
import suwayomi.tachidesk.manga.impl.extension.Extension.getExtensionIconUrl
|
||||||
import suwayomi.tachidesk.manga.impl.extension.github.ExtensionGithubApi
|
import suwayomi.tachidesk.manga.impl.extension.github.ExtensionGithubApi
|
||||||
import suwayomi.tachidesk.manga.impl.extension.github.OnlineExtension
|
import suwayomi.tachidesk.manga.impl.extension.github.OnlineExtension
|
||||||
@@ -125,57 +126,59 @@ object ExtensionsList {
|
|||||||
.groupBy { it.second[ExtensionTable.isInstalled] }
|
.groupBy { it.second[ExtensionTable.isInstalled] }
|
||||||
val installedExtensionsToUpdate = extensionsInstalled[true].orEmpty()
|
val installedExtensionsToUpdate = extensionsInstalled[true].orEmpty()
|
||||||
if (installedExtensionsToUpdate.isNotEmpty()) {
|
if (installedExtensionsToUpdate.isNotEmpty()) {
|
||||||
BatchUpdateStatement(ExtensionTable).apply {
|
BatchUpdateStatement(ExtensionTable)
|
||||||
installedExtensionsToUpdate.forEach { (foundExtension, extensionRecord) ->
|
.apply {
|
||||||
addBatch(EntityID(extensionRecord[ExtensionTable.id].value, ExtensionTable))
|
installedExtensionsToUpdate.forEach { (foundExtension, extensionRecord) ->
|
||||||
// Always update icon url and repo
|
addBatch(EntityID(extensionRecord[ExtensionTable.id].value, ExtensionTable))
|
||||||
this[ExtensionTable.iconUrl] = foundExtension.iconUrl
|
// Always update icon url and repo
|
||||||
this[ExtensionTable.repo] = foundExtension.repo
|
this[ExtensionTable.iconUrl] = foundExtension.iconUrl
|
||||||
|
this[ExtensionTable.repo] = foundExtension.repo
|
||||||
|
|
||||||
// add these because batch updates need matching columns
|
// add these because batch updates need matching columns
|
||||||
this[ExtensionTable.hasUpdate] = extensionRecord[ExtensionTable.hasUpdate]
|
this[ExtensionTable.hasUpdate] = extensionRecord[ExtensionTable.hasUpdate]
|
||||||
this[ExtensionTable.isObsolete] = extensionRecord[ExtensionTable.isObsolete]
|
this[ExtensionTable.isObsolete] = extensionRecord[ExtensionTable.isObsolete]
|
||||||
|
|
||||||
// a previously removed extension is now available again
|
// a previously removed extension is now available again
|
||||||
if (extensionRecord[ExtensionTable.isObsolete] &&
|
if (extensionRecord[ExtensionTable.isObsolete] &&
|
||||||
foundExtension.versionCode >= extensionRecord[ExtensionTable.versionCode]
|
foundExtension.versionCode >= extensionRecord[ExtensionTable.versionCode]
|
||||||
) {
|
) {
|
||||||
this[ExtensionTable.isObsolete] = false
|
this[ExtensionTable.isObsolete] = false
|
||||||
}
|
|
||||||
|
|
||||||
when {
|
|
||||||
foundExtension.versionCode > extensionRecord[ExtensionTable.versionCode] -> {
|
|
||||||
// there is an update
|
|
||||||
this[ExtensionTable.hasUpdate] = true
|
|
||||||
updateMap.putIfAbsent(foundExtension.pkgName, foundExtension)
|
|
||||||
}
|
}
|
||||||
|
|
||||||
foundExtension.versionCode < extensionRecord[ExtensionTable.versionCode] -> {
|
when {
|
||||||
// somehow the user installed an invalid version
|
foundExtension.versionCode > extensionRecord[ExtensionTable.versionCode] -> {
|
||||||
this[ExtensionTable.isObsolete] = true
|
// there is an update
|
||||||
|
this[ExtensionTable.hasUpdate] = true
|
||||||
|
updateMap.putIfAbsent(foundExtension.pkgName, foundExtension)
|
||||||
|
}
|
||||||
|
|
||||||
|
foundExtension.versionCode < extensionRecord[ExtensionTable.versionCode] -> {
|
||||||
|
// somehow the user installed an invalid version
|
||||||
|
this[ExtensionTable.isObsolete] = true
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}.toExecutable()
|
||||||
execute(this@transaction)
|
.execute(this@transaction)
|
||||||
}
|
|
||||||
}
|
}
|
||||||
val extensionsToFullyUpdate = extensionsInstalled[false].orEmpty()
|
val extensionsToFullyUpdate = extensionsInstalled[false].orEmpty()
|
||||||
if (extensionsToFullyUpdate.isNotEmpty()) {
|
if (extensionsToFullyUpdate.isNotEmpty()) {
|
||||||
BatchUpdateStatement(ExtensionTable).apply {
|
BatchUpdateStatement(ExtensionTable)
|
||||||
extensionsToFullyUpdate.forEach { (foundExtension, extensionRecord) ->
|
.apply {
|
||||||
addBatch(EntityID(extensionRecord[ExtensionTable.id].value, ExtensionTable))
|
extensionsToFullyUpdate.forEach { (foundExtension, extensionRecord) ->
|
||||||
// extension is not installed, so we can overwrite the data without a care
|
addBatch(EntityID(extensionRecord[ExtensionTable.id].value, ExtensionTable))
|
||||||
this[ExtensionTable.repo] = foundExtension.repo
|
// extension is not installed, so we can overwrite the data without a care
|
||||||
this[ExtensionTable.name] = foundExtension.name
|
this[ExtensionTable.repo] = foundExtension.repo
|
||||||
this[ExtensionTable.versionName] = foundExtension.versionName
|
this[ExtensionTable.name] = foundExtension.name
|
||||||
this[ExtensionTable.versionCode] = foundExtension.versionCode
|
this[ExtensionTable.versionName] = foundExtension.versionName
|
||||||
this[ExtensionTable.lang] = foundExtension.lang
|
this[ExtensionTable.versionCode] = foundExtension.versionCode
|
||||||
this[ExtensionTable.isNsfw] = foundExtension.isNsfw
|
this[ExtensionTable.lang] = foundExtension.lang
|
||||||
this[ExtensionTable.apkName] = foundExtension.apkName
|
this[ExtensionTable.isNsfw] = foundExtension.isNsfw
|
||||||
this[ExtensionTable.iconUrl] = foundExtension.iconUrl
|
this[ExtensionTable.apkName] = foundExtension.apkName
|
||||||
}
|
this[ExtensionTable.iconUrl] = foundExtension.iconUrl
|
||||||
execute(this@transaction)
|
}
|
||||||
}
|
}.toExecutable()
|
||||||
|
.execute(this@transaction)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if (extensionsToInsert.isNotEmpty()) {
|
if (extensionsToInsert.isNotEmpty()) {
|
||||||
|
|||||||
@@ -14,8 +14,10 @@ import kotlinx.serialization.json.put
|
|||||||
import okhttp3.MediaType.Companion.toMediaType
|
import okhttp3.MediaType.Companion.toMediaType
|
||||||
import okhttp3.Request
|
import okhttp3.Request
|
||||||
import okhttp3.RequestBody.Companion.toRequestBody
|
import okhttp3.RequestBody.Companion.toRequestBody
|
||||||
import org.jetbrains.exposed.sql.transactions.transaction
|
import org.jetbrains.exposed.v1.core.eq
|
||||||
import org.jetbrains.exposed.sql.update
|
import org.jetbrains.exposed.v1.jdbc.select
|
||||||
|
import org.jetbrains.exposed.v1.jdbc.transactions.transaction
|
||||||
|
import org.jetbrains.exposed.v1.jdbc.update
|
||||||
import suwayomi.tachidesk.graphql.types.KoSyncStatusPayload
|
import suwayomi.tachidesk.graphql.types.KoSyncStatusPayload
|
||||||
import suwayomi.tachidesk.graphql.types.KoreaderSyncChecksumMethod
|
import suwayomi.tachidesk.graphql.types.KoreaderSyncChecksumMethod
|
||||||
import suwayomi.tachidesk.graphql.types.KoreaderSyncConflictStrategy
|
import suwayomi.tachidesk.graphql.types.KoreaderSyncConflictStrategy
|
||||||
|
|||||||
@@ -6,16 +6,17 @@ import kotlinx.coroutines.Dispatchers
|
|||||||
import kotlinx.coroutines.SupervisorJob
|
import kotlinx.coroutines.SupervisorJob
|
||||||
import kotlinx.coroutines.launch
|
import kotlinx.coroutines.launch
|
||||||
import kotlinx.serialization.Serializable
|
import kotlinx.serialization.Serializable
|
||||||
import org.jetbrains.exposed.dao.id.EntityID
|
import org.jetbrains.exposed.v1.core.ResultRow
|
||||||
import org.jetbrains.exposed.sql.ResultRow
|
import org.jetbrains.exposed.v1.core.SortOrder
|
||||||
import org.jetbrains.exposed.sql.SortOrder
|
import org.jetbrains.exposed.v1.core.and
|
||||||
import org.jetbrains.exposed.sql.SqlExpressionBuilder.eq
|
import org.jetbrains.exposed.v1.core.dao.id.EntityID
|
||||||
import org.jetbrains.exposed.sql.and
|
import org.jetbrains.exposed.v1.core.eq
|
||||||
import org.jetbrains.exposed.sql.batchInsert
|
import org.jetbrains.exposed.v1.core.statements.BatchUpdateStatement
|
||||||
import org.jetbrains.exposed.sql.deleteWhere
|
import org.jetbrains.exposed.v1.jdbc.batchInsert
|
||||||
import org.jetbrains.exposed.sql.selectAll
|
import org.jetbrains.exposed.v1.jdbc.deleteWhere
|
||||||
import org.jetbrains.exposed.sql.statements.BatchUpdateStatement
|
import org.jetbrains.exposed.v1.jdbc.selectAll
|
||||||
import org.jetbrains.exposed.sql.transactions.transaction
|
import org.jetbrains.exposed.v1.jdbc.statements.toExecutable
|
||||||
|
import org.jetbrains.exposed.v1.jdbc.transactions.transaction
|
||||||
import org.jsoup.Jsoup
|
import org.jsoup.Jsoup
|
||||||
import suwayomi.tachidesk.manga.impl.track.tracker.DeletableTracker
|
import suwayomi.tachidesk.manga.impl.track.tracker.DeletableTracker
|
||||||
import suwayomi.tachidesk.manga.impl.track.tracker.TrackerManager
|
import suwayomi.tachidesk.manga.impl.track.tracker.TrackerManager
|
||||||
@@ -427,23 +428,24 @@ object Track {
|
|||||||
fun updateTrackRecords(tracks: List<Track>) =
|
fun updateTrackRecords(tracks: List<Track>) =
|
||||||
transaction {
|
transaction {
|
||||||
if (tracks.isNotEmpty()) {
|
if (tracks.isNotEmpty()) {
|
||||||
BatchUpdateStatement(TrackRecordTable).apply {
|
BatchUpdateStatement(TrackRecordTable)
|
||||||
tracks.forEach {
|
.apply {
|
||||||
addBatch(EntityID(it.id!!, TrackRecordTable))
|
tracks.forEach {
|
||||||
this[remoteId] = it.remote_id
|
addBatch(EntityID(it.id!!, TrackRecordTable))
|
||||||
this[libraryId] = it.library_id
|
this[remoteId] = it.remote_id
|
||||||
this[title] = it.title
|
this[libraryId] = it.library_id
|
||||||
this[lastChapterRead] = it.last_chapter_read
|
this[title] = it.title
|
||||||
this[totalChapters] = it.total_chapters
|
this[lastChapterRead] = it.last_chapter_read
|
||||||
this[status] = it.status
|
this[totalChapters] = it.total_chapters
|
||||||
this[score] = it.score
|
this[status] = it.status
|
||||||
this[remoteUrl] = it.tracking_url
|
this[score] = it.score
|
||||||
this[startDate] = it.started_reading_date
|
this[remoteUrl] = it.tracking_url
|
||||||
this[finishDate] = it.finished_reading_date
|
this[startDate] = it.started_reading_date
|
||||||
this[private] = it.private
|
this[finishDate] = it.finished_reading_date
|
||||||
}
|
this[private] = it.private
|
||||||
execute(this@transaction)
|
}
|
||||||
}
|
}.toExecutable()
|
||||||
|
.execute(this@transaction)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -1,11 +1,9 @@
|
|||||||
package suwayomi.tachidesk.manga.impl.track.tracker.model
|
package suwayomi.tachidesk.manga.impl.track.tracker.model
|
||||||
|
|
||||||
import org.jetbrains.exposed.sql.ResultRow
|
import org.jetbrains.exposed.v1.core.ResultRow
|
||||||
import suwayomi.tachidesk.manga.impl.backup.proto.models.BackupTracking
|
import suwayomi.tachidesk.manga.impl.backup.proto.models.BackupTracking
|
||||||
import suwayomi.tachidesk.manga.model.dataclass.TrackRecordDataClass
|
import suwayomi.tachidesk.manga.model.dataclass.TrackRecordDataClass
|
||||||
import suwayomi.tachidesk.manga.model.table.TrackRecordTable
|
import suwayomi.tachidesk.manga.model.table.TrackRecordTable
|
||||||
import suwayomi.tachidesk.manga.model.table.TrackRecordTable.lastChapterRead
|
|
||||||
import suwayomi.tachidesk.manga.model.table.TrackRecordTable.remoteUrl
|
|
||||||
import suwayomi.tachidesk.manga.model.table.TrackSearchTable
|
import suwayomi.tachidesk.manga.model.table.TrackSearchTable
|
||||||
|
|
||||||
fun ResultRow.toTrackRecordDataClass(): TrackRecordDataClass =
|
fun ResultRow.toTrackRecordDataClass(): TrackRecordDataClass =
|
||||||
|
|||||||
@@ -7,10 +7,10 @@ package suwayomi.tachidesk.manga.impl.util
|
|||||||
* License, v. 2.0. If a copy of the MPL was not distributed with this
|
* 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/. */
|
* file, You can obtain one at https://mozilla.org/MPL/2.0/. */
|
||||||
|
|
||||||
import io.github.oshai.kotlinlogging.KLogger
|
|
||||||
import io.github.oshai.kotlinlogging.KotlinLogging
|
import io.github.oshai.kotlinlogging.KotlinLogging
|
||||||
import org.jetbrains.exposed.sql.selectAll
|
import org.jetbrains.exposed.v1.core.eq
|
||||||
import org.jetbrains.exposed.sql.transactions.transaction
|
import org.jetbrains.exposed.v1.jdbc.selectAll
|
||||||
|
import org.jetbrains.exposed.v1.jdbc.transactions.transaction
|
||||||
import suwayomi.tachidesk.manga.impl.util.source.GetCatalogueSource
|
import suwayomi.tachidesk.manga.impl.util.source.GetCatalogueSource
|
||||||
import suwayomi.tachidesk.manga.model.table.ChapterTable
|
import suwayomi.tachidesk.manga.model.table.ChapterTable
|
||||||
import suwayomi.tachidesk.manga.model.table.MangaTable
|
import suwayomi.tachidesk.manga.model.table.MangaTable
|
||||||
|
|||||||
@@ -4,10 +4,11 @@ import eu.kanade.tachiyomi.source.local.metadata.COMIC_INFO_FILE
|
|||||||
import eu.kanade.tachiyomi.source.local.metadata.ComicInfo
|
import eu.kanade.tachiyomi.source.local.metadata.ComicInfo
|
||||||
import eu.kanade.tachiyomi.source.local.metadata.ComicInfoPublishingStatus
|
import eu.kanade.tachiyomi.source.local.metadata.ComicInfoPublishingStatus
|
||||||
import nl.adaptivity.xmlutil.serialization.XML
|
import nl.adaptivity.xmlutil.serialization.XML
|
||||||
import org.jetbrains.exposed.sql.ResultRow
|
import org.jetbrains.exposed.v1.core.ResultRow
|
||||||
import org.jetbrains.exposed.sql.SortOrder
|
import org.jetbrains.exposed.v1.core.SortOrder
|
||||||
import org.jetbrains.exposed.sql.selectAll
|
import org.jetbrains.exposed.v1.core.eq
|
||||||
import org.jetbrains.exposed.sql.transactions.transaction
|
import org.jetbrains.exposed.v1.jdbc.selectAll
|
||||||
|
import org.jetbrains.exposed.v1.jdbc.transactions.transaction
|
||||||
import suwayomi.tachidesk.manga.model.table.CategoryMangaTable
|
import suwayomi.tachidesk.manga.model.table.CategoryMangaTable
|
||||||
import suwayomi.tachidesk.manga.model.table.CategoryTable
|
import suwayomi.tachidesk.manga.model.table.CategoryTable
|
||||||
import suwayomi.tachidesk.manga.model.table.ChapterTable
|
import suwayomi.tachidesk.manga.model.table.ChapterTable
|
||||||
|
|||||||
@@ -7,7 +7,7 @@ package suwayomi.tachidesk.manga.impl.util.lang
|
|||||||
* License, v. 2.0. If a copy of the MPL was not distributed with this
|
* 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/. */
|
* file, You can obtain one at https://mozilla.org/MPL/2.0/. */
|
||||||
|
|
||||||
import org.jetbrains.exposed.sql.Query
|
import org.jetbrains.exposed.v1.jdbc.Query
|
||||||
|
|
||||||
fun Query.isEmpty() = this.empty()
|
fun Query.isEmpty() = this.empty()
|
||||||
|
|
||||||
|
|||||||
@@ -12,8 +12,9 @@ import eu.kanade.tachiyomi.source.Source
|
|||||||
import eu.kanade.tachiyomi.source.SourceFactory
|
import eu.kanade.tachiyomi.source.SourceFactory
|
||||||
import eu.kanade.tachiyomi.source.online.HttpSource
|
import eu.kanade.tachiyomi.source.online.HttpSource
|
||||||
import io.github.oshai.kotlinlogging.KotlinLogging
|
import io.github.oshai.kotlinlogging.KotlinLogging
|
||||||
import org.jetbrains.exposed.sql.selectAll
|
import org.jetbrains.exposed.v1.core.eq
|
||||||
import org.jetbrains.exposed.sql.transactions.transaction
|
import org.jetbrains.exposed.v1.jdbc.selectAll
|
||||||
|
import org.jetbrains.exposed.v1.jdbc.transactions.transaction
|
||||||
import suwayomi.tachidesk.manga.impl.util.PackageTools.loadExtensionSources
|
import suwayomi.tachidesk.manga.impl.util.PackageTools.loadExtensionSources
|
||||||
import suwayomi.tachidesk.manga.model.table.ExtensionTable
|
import suwayomi.tachidesk.manga.model.table.ExtensionTable
|
||||||
import suwayomi.tachidesk.manga.model.table.SourceTable
|
import suwayomi.tachidesk.manga.model.table.SourceTable
|
||||||
|
|||||||
@@ -7,8 +7,8 @@ package suwayomi.tachidesk.manga.model.table
|
|||||||
* License, v. 2.0. If a copy of the MPL was not distributed with this
|
* 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/. */
|
* file, You can obtain one at https://mozilla.org/MPL/2.0/. */
|
||||||
|
|
||||||
import org.jetbrains.exposed.dao.id.IntIdTable
|
import org.jetbrains.exposed.v1.core.ReferenceOption
|
||||||
import org.jetbrains.exposed.sql.ReferenceOption
|
import org.jetbrains.exposed.v1.core.dao.id.IntIdTable
|
||||||
|
|
||||||
object CategoryMangaTable : IntIdTable() {
|
object CategoryMangaTable : IntIdTable() {
|
||||||
val category = reference("category", CategoryTable, ReferenceOption.CASCADE)
|
val category = reference("category", CategoryTable, ReferenceOption.CASCADE)
|
||||||
|
|||||||
@@ -7,8 +7,8 @@ package suwayomi.tachidesk.manga.model.table
|
|||||||
* License, v. 2.0. If a copy of the MPL was not distributed with this
|
* 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/. */
|
* file, You can obtain one at https://mozilla.org/MPL/2.0/. */
|
||||||
|
|
||||||
import org.jetbrains.exposed.dao.id.IntIdTable
|
import org.jetbrains.exposed.v1.core.ReferenceOption
|
||||||
import org.jetbrains.exposed.sql.ReferenceOption
|
import org.jetbrains.exposed.v1.core.dao.id.IntIdTable
|
||||||
import suwayomi.tachidesk.manga.model.table.CategoryMetaTable.ref
|
import suwayomi.tachidesk.manga.model.table.CategoryMetaTable.ref
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|||||||
@@ -7,8 +7,8 @@ package suwayomi.tachidesk.manga.model.table
|
|||||||
* License, v. 2.0. If a copy of the MPL was not distributed with this
|
* 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/. */
|
* file, You can obtain one at https://mozilla.org/MPL/2.0/. */
|
||||||
|
|
||||||
import org.jetbrains.exposed.dao.id.IntIdTable
|
import org.jetbrains.exposed.v1.core.ResultRow
|
||||||
import org.jetbrains.exposed.sql.ResultRow
|
import org.jetbrains.exposed.v1.core.dao.id.IntIdTable
|
||||||
import suwayomi.tachidesk.manga.impl.Category
|
import suwayomi.tachidesk.manga.impl.Category
|
||||||
import suwayomi.tachidesk.manga.model.dataclass.CategoryDataClass
|
import suwayomi.tachidesk.manga.model.dataclass.CategoryDataClass
|
||||||
import suwayomi.tachidesk.manga.model.dataclass.IncludeOrExclude
|
import suwayomi.tachidesk.manga.model.dataclass.IncludeOrExclude
|
||||||
|
|||||||
@@ -7,8 +7,8 @@ package suwayomi.tachidesk.manga.model.table
|
|||||||
* License, v. 2.0. If a copy of the MPL was not distributed with this
|
* 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/. */
|
* file, You can obtain one at https://mozilla.org/MPL/2.0/. */
|
||||||
|
|
||||||
import org.jetbrains.exposed.dao.id.IntIdTable
|
import org.jetbrains.exposed.v1.core.ReferenceOption
|
||||||
import org.jetbrains.exposed.sql.ReferenceOption
|
import org.jetbrains.exposed.v1.core.dao.id.IntIdTable
|
||||||
import suwayomi.tachidesk.manga.model.table.ChapterMetaTable.ref
|
import suwayomi.tachidesk.manga.model.table.ChapterMetaTable.ref
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|||||||
@@ -7,11 +7,12 @@ package suwayomi.tachidesk.manga.model.table
|
|||||||
* License, v. 2.0. If a copy of the MPL was not distributed with this
|
* 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/. */
|
* file, You can obtain one at https://mozilla.org/MPL/2.0/. */
|
||||||
|
|
||||||
import org.jetbrains.exposed.dao.id.IntIdTable
|
import org.jetbrains.exposed.v1.core.ReferenceOption
|
||||||
import org.jetbrains.exposed.sql.ReferenceOption
|
import org.jetbrains.exposed.v1.core.ResultRow
|
||||||
import org.jetbrains.exposed.sql.ResultRow
|
import org.jetbrains.exposed.v1.core.dao.id.IntIdTable
|
||||||
import org.jetbrains.exposed.sql.selectAll
|
import org.jetbrains.exposed.v1.core.eq
|
||||||
import org.jetbrains.exposed.sql.transactions.transaction
|
import org.jetbrains.exposed.v1.jdbc.selectAll
|
||||||
|
import org.jetbrains.exposed.v1.jdbc.transactions.transaction
|
||||||
import suwayomi.tachidesk.manga.impl.Chapter.getChapterMetaMap
|
import suwayomi.tachidesk.manga.impl.Chapter.getChapterMetaMap
|
||||||
import suwayomi.tachidesk.manga.model.dataclass.ChapterDataClass
|
import suwayomi.tachidesk.manga.model.dataclass.ChapterDataClass
|
||||||
import suwayomi.tachidesk.manga.model.table.columns.truncatingVarchar
|
import suwayomi.tachidesk.manga.model.table.columns.truncatingVarchar
|
||||||
|
|||||||
@@ -7,7 +7,7 @@ package suwayomi.tachidesk.manga.model.table
|
|||||||
* License, v. 2.0. If a copy of the MPL was not distributed with this
|
* 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/. */
|
* file, You can obtain one at https://mozilla.org/MPL/2.0/. */
|
||||||
|
|
||||||
import org.jetbrains.exposed.dao.id.IntIdTable
|
import org.jetbrains.exposed.v1.core.dao.id.IntIdTable
|
||||||
|
|
||||||
object ExtensionTable : IntIdTable() {
|
object ExtensionTable : IntIdTable() {
|
||||||
val apkName = varchar("apk_name", 1024)
|
val apkName = varchar("apk_name", 1024)
|
||||||
|
|||||||
@@ -7,8 +7,8 @@ package suwayomi.tachidesk.manga.model.table
|
|||||||
* License, v. 2.0. If a copy of the MPL was not distributed with this
|
* 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/. */
|
* file, You can obtain one at https://mozilla.org/MPL/2.0/. */
|
||||||
|
|
||||||
import org.jetbrains.exposed.dao.id.IntIdTable
|
import org.jetbrains.exposed.v1.core.ReferenceOption
|
||||||
import org.jetbrains.exposed.sql.ReferenceOption
|
import org.jetbrains.exposed.v1.core.dao.id.IntIdTable
|
||||||
import suwayomi.tachidesk.manga.model.table.MangaMetaTable.ref
|
import suwayomi.tachidesk.manga.model.table.MangaMetaTable.ref
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|||||||
@@ -9,8 +9,8 @@ package suwayomi.tachidesk.manga.model.table
|
|||||||
|
|
||||||
import eu.kanade.tachiyomi.source.model.SManga
|
import eu.kanade.tachiyomi.source.model.SManga
|
||||||
import eu.kanade.tachiyomi.source.model.UpdateStrategy
|
import eu.kanade.tachiyomi.source.model.UpdateStrategy
|
||||||
import org.jetbrains.exposed.dao.id.IntIdTable
|
import org.jetbrains.exposed.v1.core.ResultRow
|
||||||
import org.jetbrains.exposed.sql.ResultRow
|
import org.jetbrains.exposed.v1.core.dao.id.IntIdTable
|
||||||
import suwayomi.tachidesk.manga.impl.Manga.getMangaMetaMap
|
import suwayomi.tachidesk.manga.impl.Manga.getMangaMetaMap
|
||||||
import suwayomi.tachidesk.manga.impl.MangaList.proxyThumbnailUrl
|
import suwayomi.tachidesk.manga.impl.MangaList.proxyThumbnailUrl
|
||||||
import suwayomi.tachidesk.manga.model.dataclass.MangaDataClass
|
import suwayomi.tachidesk.manga.model.dataclass.MangaDataClass
|
||||||
|
|||||||
@@ -7,8 +7,8 @@ package suwayomi.tachidesk.manga.model.table
|
|||||||
* License, v. 2.0. If a copy of the MPL was not distributed with this
|
* 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/. */
|
* file, You can obtain one at https://mozilla.org/MPL/2.0/. */
|
||||||
|
|
||||||
import org.jetbrains.exposed.dao.id.IntIdTable
|
import org.jetbrains.exposed.v1.core.ReferenceOption
|
||||||
import org.jetbrains.exposed.sql.ReferenceOption
|
import org.jetbrains.exposed.v1.core.dao.id.IntIdTable
|
||||||
import suwayomi.tachidesk.manga.model.table.columns.unlimitedVarchar
|
import suwayomi.tachidesk.manga.model.table.columns.unlimitedVarchar
|
||||||
|
|
||||||
object PageTable : IntIdTable() {
|
object PageTable : IntIdTable() {
|
||||||
|
|||||||
@@ -7,8 +7,8 @@ package suwayomi.tachidesk.manga.model.table
|
|||||||
* License, v. 2.0. If a copy of the MPL was not distributed with this
|
* 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/. */
|
* file, You can obtain one at https://mozilla.org/MPL/2.0/. */
|
||||||
|
|
||||||
import org.jetbrains.exposed.dao.id.IntIdTable
|
import org.jetbrains.exposed.v1.core.dao.id.IntIdTable
|
||||||
import suwayomi.tachidesk.manga.model.table.ChapterMetaTable.ref
|
import suwayomi.tachidesk.manga.model.table.SourceMetaTable.ref
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Metadata storage for clients, about Source with id == [ref].
|
* Metadata storage for clients, about Source with id == [ref].
|
||||||
|
|||||||
@@ -7,7 +7,7 @@ package suwayomi.tachidesk.manga.model.table
|
|||||||
* License, v. 2.0. If a copy of the MPL was not distributed with this
|
* 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/. */
|
* file, You can obtain one at https://mozilla.org/MPL/2.0/. */
|
||||||
|
|
||||||
import org.jetbrains.exposed.dao.id.IdTable
|
import org.jetbrains.exposed.v1.core.dao.id.IdTable
|
||||||
|
|
||||||
object SourceTable : IdTable<Long>() {
|
object SourceTable : IdTable<Long>() {
|
||||||
override val id = long("id").entityId()
|
override val id = long("id").entityId()
|
||||||
|
|||||||
@@ -7,8 +7,8 @@ package suwayomi.tachidesk.manga.model.table
|
|||||||
* License, v. 2.0. If a copy of the MPL was not distributed with this
|
* 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/. */
|
* file, You can obtain one at https://mozilla.org/MPL/2.0/. */
|
||||||
|
|
||||||
import org.jetbrains.exposed.dao.id.IntIdTable
|
import org.jetbrains.exposed.v1.core.ReferenceOption
|
||||||
import org.jetbrains.exposed.sql.ReferenceOption
|
import org.jetbrains.exposed.v1.core.dao.id.IntIdTable
|
||||||
import suwayomi.tachidesk.manga.model.table.columns.truncatingVarchar
|
import suwayomi.tachidesk.manga.model.table.columns.truncatingVarchar
|
||||||
|
|
||||||
object TrackRecordTable : IntIdTable() {
|
object TrackRecordTable : IntIdTable() {
|
||||||
|
|||||||
@@ -7,14 +7,16 @@ package suwayomi.tachidesk.manga.model.table
|
|||||||
* License, v. 2.0. If a copy of the MPL was not distributed with this
|
* 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/. */
|
* file, You can obtain one at https://mozilla.org/MPL/2.0/. */
|
||||||
|
|
||||||
import org.jetbrains.exposed.dao.id.EntityID
|
import org.jetbrains.exposed.v1.core.ResultRow
|
||||||
import org.jetbrains.exposed.dao.id.IntIdTable
|
import org.jetbrains.exposed.v1.core.and
|
||||||
import org.jetbrains.exposed.sql.ResultRow
|
import org.jetbrains.exposed.v1.core.dao.id.EntityID
|
||||||
import org.jetbrains.exposed.sql.and
|
import org.jetbrains.exposed.v1.core.dao.id.IntIdTable
|
||||||
import org.jetbrains.exposed.sql.batchInsert
|
import org.jetbrains.exposed.v1.core.inList
|
||||||
import org.jetbrains.exposed.sql.selectAll
|
import org.jetbrains.exposed.v1.core.statements.BatchUpdateStatement
|
||||||
import org.jetbrains.exposed.sql.statements.BatchUpdateStatement
|
import org.jetbrains.exposed.v1.jdbc.batchInsert
|
||||||
import org.jetbrains.exposed.sql.transactions.transaction
|
import org.jetbrains.exposed.v1.jdbc.selectAll
|
||||||
|
import org.jetbrains.exposed.v1.jdbc.statements.toExecutable
|
||||||
|
import org.jetbrains.exposed.v1.jdbc.transactions.transaction
|
||||||
import suwayomi.tachidesk.manga.impl.track.tracker.model.TrackSearch
|
import suwayomi.tachidesk.manga.impl.track.tracker.model.TrackSearch
|
||||||
import suwayomi.tachidesk.manga.model.table.columns.truncatingVarchar
|
import suwayomi.tachidesk.manga.model.table.columns.truncatingVarchar
|
||||||
|
|
||||||
@@ -69,30 +71,31 @@ fun List<TrackSearch>.insertAll(): List<ResultRow> {
|
|||||||
val toUpdate = grouped[true]
|
val toUpdate = grouped[true]
|
||||||
val toInsert = grouped[false]?.map { it.second }
|
val toInsert = grouped[false]?.map { it.second }
|
||||||
if (!toUpdate.isNullOrEmpty()) {
|
if (!toUpdate.isNullOrEmpty()) {
|
||||||
BatchUpdateStatement(TrackSearchTable).apply {
|
BatchUpdateStatement(TrackSearchTable)
|
||||||
toUpdate.forEach { (id, trackSearch) ->
|
.apply {
|
||||||
id ?: return@forEach
|
toUpdate.forEach { (id, trackSearch) ->
|
||||||
addBatch(EntityID(id, TrackSearchTable))
|
id ?: return@forEach
|
||||||
this[TrackSearchTable.title] = trackSearch.title
|
addBatch(EntityID(id, TrackSearchTable))
|
||||||
this[TrackSearchTable.totalChapters] = trackSearch.total_chapters
|
this[TrackSearchTable.title] = trackSearch.title
|
||||||
this[TrackSearchTable.trackingUrl] = trackSearch.tracking_url
|
this[TrackSearchTable.totalChapters] = trackSearch.total_chapters
|
||||||
this[TrackSearchTable.coverUrl] = trackSearch.cover_url
|
this[TrackSearchTable.trackingUrl] = trackSearch.tracking_url
|
||||||
this[TrackSearchTable.summary] = trackSearch.summary
|
this[TrackSearchTable.coverUrl] = trackSearch.cover_url
|
||||||
this[TrackSearchTable.publishingStatus] = trackSearch.publishing_status
|
this[TrackSearchTable.summary] = trackSearch.summary
|
||||||
this[TrackSearchTable.publishingType] = trackSearch.publishing_type
|
this[TrackSearchTable.publishingStatus] = trackSearch.publishing_status
|
||||||
this[TrackSearchTable.startDate] = trackSearch.start_date
|
this[TrackSearchTable.publishingType] = trackSearch.publishing_type
|
||||||
this[TrackSearchTable.libraryId] = trackSearch.library_id
|
this[TrackSearchTable.startDate] = trackSearch.start_date
|
||||||
this[TrackSearchTable.lastChapterRead] = trackSearch.last_chapter_read
|
this[TrackSearchTable.libraryId] = trackSearch.library_id
|
||||||
this[TrackSearchTable.status] = trackSearch.status
|
this[TrackSearchTable.lastChapterRead] = trackSearch.last_chapter_read
|
||||||
this[TrackSearchTable.score] = trackSearch.score
|
this[TrackSearchTable.status] = trackSearch.status
|
||||||
this[TrackSearchTable.startedReadingDate] = trackSearch.started_reading_date
|
this[TrackSearchTable.score] = trackSearch.score
|
||||||
this[TrackSearchTable.finishedReadingDate] = trackSearch.finished_reading_date
|
this[TrackSearchTable.startedReadingDate] = trackSearch.started_reading_date
|
||||||
this[TrackSearchTable.private] = trackSearch.private
|
this[TrackSearchTable.finishedReadingDate] = trackSearch.finished_reading_date
|
||||||
this[TrackSearchTable.authors] = trackSearch.authors.ifEmpty { null }?.joinToString(",")
|
this[TrackSearchTable.private] = trackSearch.private
|
||||||
this[TrackSearchTable.artists] = trackSearch.artists.ifEmpty { null }?.joinToString(",")
|
this[TrackSearchTable.authors] = trackSearch.authors.ifEmpty { null }?.joinToString(",")
|
||||||
}
|
this[TrackSearchTable.artists] = trackSearch.artists.ifEmpty { null }?.joinToString(",")
|
||||||
execute(this@transaction)
|
}
|
||||||
}
|
}.toExecutable()
|
||||||
|
.execute(this@transaction)
|
||||||
}
|
}
|
||||||
val insertedRows =
|
val insertedRows =
|
||||||
if (!toInsert.isNullOrEmpty()) {
|
if (!toInsert.isNullOrEmpty()) {
|
||||||
|
|||||||
@@ -1,9 +1,9 @@
|
|||||||
package suwayomi.tachidesk.manga.model.table.columns
|
package suwayomi.tachidesk.manga.model.table.columns
|
||||||
|
|
||||||
import io.github.oshai.kotlinlogging.KotlinLogging
|
import io.github.oshai.kotlinlogging.KotlinLogging
|
||||||
import org.jetbrains.exposed.sql.Column
|
import org.jetbrains.exposed.v1.core.Column
|
||||||
import org.jetbrains.exposed.sql.Table
|
import org.jetbrains.exposed.v1.core.Table
|
||||||
import org.jetbrains.exposed.sql.VarCharColumnType
|
import org.jetbrains.exposed.v1.core.VarCharColumnType
|
||||||
import suwayomi.tachidesk.graphql.types.DatabaseType
|
import suwayomi.tachidesk.graphql.types.DatabaseType
|
||||||
import suwayomi.tachidesk.server.serverConfig
|
import suwayomi.tachidesk.server.serverConfig
|
||||||
|
|
||||||
|
|||||||
@@ -1,7 +1,7 @@
|
|||||||
package suwayomi.tachidesk.opds.impl
|
package suwayomi.tachidesk.opds.impl
|
||||||
|
|
||||||
import io.github.oshai.kotlinlogging.KotlinLogging
|
import io.github.oshai.kotlinlogging.KotlinLogging
|
||||||
import org.jetbrains.exposed.sql.SortOrder
|
import org.jetbrains.exposed.v1.core.SortOrder
|
||||||
import suwayomi.tachidesk.i18n.MR
|
import suwayomi.tachidesk.i18n.MR
|
||||||
import suwayomi.tachidesk.manga.impl.MangaList.proxyThumbnailUrl
|
import suwayomi.tachidesk.manga.impl.MangaList.proxyThumbnailUrl
|
||||||
import suwayomi.tachidesk.manga.model.table.ChapterTable
|
import suwayomi.tachidesk.manga.model.table.ChapterTable
|
||||||
|
|||||||
@@ -1,14 +1,16 @@
|
|||||||
package suwayomi.tachidesk.opds.repository
|
package suwayomi.tachidesk.opds.repository
|
||||||
|
|
||||||
import org.jetbrains.exposed.sql.Column
|
import org.jetbrains.exposed.v1.core.Column
|
||||||
import org.jetbrains.exposed.sql.JoinType
|
import org.jetbrains.exposed.v1.core.JoinType
|
||||||
import org.jetbrains.exposed.sql.Op
|
import org.jetbrains.exposed.v1.core.Op
|
||||||
import org.jetbrains.exposed.sql.ResultRow
|
import org.jetbrains.exposed.v1.core.ResultRow
|
||||||
import org.jetbrains.exposed.sql.SortOrder
|
import org.jetbrains.exposed.v1.core.SortOrder
|
||||||
import org.jetbrains.exposed.sql.SqlExpressionBuilder.eq
|
import org.jetbrains.exposed.v1.core.and
|
||||||
import org.jetbrains.exposed.sql.and
|
import org.jetbrains.exposed.v1.core.eq
|
||||||
import org.jetbrains.exposed.sql.andWhere
|
import org.jetbrains.exposed.v1.core.greater
|
||||||
import org.jetbrains.exposed.sql.transactions.transaction
|
import org.jetbrains.exposed.v1.jdbc.andWhere
|
||||||
|
import org.jetbrains.exposed.v1.jdbc.select
|
||||||
|
import org.jetbrains.exposed.v1.jdbc.transactions.transaction
|
||||||
import suwayomi.tachidesk.manga.impl.chapter.getChapterDownloadReady
|
import suwayomi.tachidesk.manga.impl.chapter.getChapterDownloadReady
|
||||||
import suwayomi.tachidesk.manga.model.table.ChapterTable
|
import suwayomi.tachidesk.manga.model.table.ChapterTable
|
||||||
import suwayomi.tachidesk.manga.model.table.MangaTable
|
import suwayomi.tachidesk.manga.model.table.MangaTable
|
||||||
|
|||||||
@@ -1,23 +1,26 @@
|
|||||||
package suwayomi.tachidesk.opds.repository
|
package suwayomi.tachidesk.opds.repository
|
||||||
|
|
||||||
import eu.kanade.tachiyomi.source.model.MangasPage
|
import eu.kanade.tachiyomi.source.model.MangasPage
|
||||||
import org.jetbrains.exposed.sql.Case
|
import org.jetbrains.exposed.v1.core.Case
|
||||||
import org.jetbrains.exposed.sql.JoinType
|
import org.jetbrains.exposed.v1.core.JoinType
|
||||||
import org.jetbrains.exposed.sql.Op
|
import org.jetbrains.exposed.v1.core.Op
|
||||||
import org.jetbrains.exposed.sql.Query
|
import org.jetbrains.exposed.v1.core.ResultRow
|
||||||
import org.jetbrains.exposed.sql.ResultRow
|
import org.jetbrains.exposed.v1.core.SortOrder
|
||||||
import org.jetbrains.exposed.sql.SortOrder
|
import org.jetbrains.exposed.v1.core.alias
|
||||||
import org.jetbrains.exposed.sql.SqlExpressionBuilder.eq
|
import org.jetbrains.exposed.v1.core.and
|
||||||
import org.jetbrains.exposed.sql.SqlExpressionBuilder.like
|
import org.jetbrains.exposed.v1.core.eq
|
||||||
import org.jetbrains.exposed.sql.alias
|
import org.jetbrains.exposed.v1.core.greater
|
||||||
import org.jetbrains.exposed.sql.and
|
import org.jetbrains.exposed.v1.core.inList
|
||||||
import org.jetbrains.exposed.sql.andWhere
|
import org.jetbrains.exposed.v1.core.intLiteral
|
||||||
import org.jetbrains.exposed.sql.intLiteral
|
import org.jetbrains.exposed.v1.core.like
|
||||||
import org.jetbrains.exposed.sql.lowerCase
|
import org.jetbrains.exposed.v1.core.lowerCase
|
||||||
import org.jetbrains.exposed.sql.max
|
import org.jetbrains.exposed.v1.core.max
|
||||||
import org.jetbrains.exposed.sql.or
|
import org.jetbrains.exposed.v1.core.or
|
||||||
import org.jetbrains.exposed.sql.sum
|
import org.jetbrains.exposed.v1.core.sum
|
||||||
import org.jetbrains.exposed.sql.transactions.transaction
|
import org.jetbrains.exposed.v1.jdbc.Query
|
||||||
|
import org.jetbrains.exposed.v1.jdbc.andWhere
|
||||||
|
import org.jetbrains.exposed.v1.jdbc.select
|
||||||
|
import org.jetbrains.exposed.v1.jdbc.transactions.transaction
|
||||||
import suwayomi.tachidesk.manga.impl.MangaList.insertOrUpdate
|
import suwayomi.tachidesk.manga.impl.MangaList.insertOrUpdate
|
||||||
import suwayomi.tachidesk.manga.impl.util.source.GetCatalogueSource
|
import suwayomi.tachidesk.manga.impl.util.source.GetCatalogueSource
|
||||||
import suwayomi.tachidesk.manga.model.dataclass.toGenreList
|
import suwayomi.tachidesk.manga.model.dataclass.toGenreList
|
||||||
|
|||||||
@@ -1,12 +1,14 @@
|
|||||||
package suwayomi.tachidesk.opds.repository
|
package suwayomi.tachidesk.opds.repository
|
||||||
|
|
||||||
import dev.icerock.moko.resources.StringResource
|
import dev.icerock.moko.resources.StringResource
|
||||||
import org.jetbrains.exposed.sql.JoinType
|
import org.jetbrains.exposed.v1.core.JoinType
|
||||||
import org.jetbrains.exposed.sql.SortOrder
|
import org.jetbrains.exposed.v1.core.SortOrder
|
||||||
import org.jetbrains.exposed.sql.alias
|
import org.jetbrains.exposed.v1.core.alias
|
||||||
import org.jetbrains.exposed.sql.count
|
import org.jetbrains.exposed.v1.core.count
|
||||||
import org.jetbrains.exposed.sql.countDistinct
|
import org.jetbrains.exposed.v1.core.countDistinct
|
||||||
import org.jetbrains.exposed.sql.transactions.transaction
|
import org.jetbrains.exposed.v1.core.eq
|
||||||
|
import org.jetbrains.exposed.v1.jdbc.select
|
||||||
|
import org.jetbrains.exposed.v1.jdbc.transactions.transaction
|
||||||
import suwayomi.tachidesk.i18n.MR
|
import suwayomi.tachidesk.i18n.MR
|
||||||
import suwayomi.tachidesk.manga.impl.extension.Extension
|
import suwayomi.tachidesk.manga.impl.extension.Extension
|
||||||
import suwayomi.tachidesk.manga.model.table.CategoryMangaTable
|
import suwayomi.tachidesk.manga.model.table.CategoryMangaTable
|
||||||
|
|||||||
@@ -52,7 +52,6 @@ import java.net.URLEncoder
|
|||||||
import java.util.Locale
|
import java.util.Locale
|
||||||
import java.util.concurrent.CompletableFuture
|
import java.util.concurrent.CompletableFuture
|
||||||
import kotlin.concurrent.thread
|
import kotlin.concurrent.thread
|
||||||
import kotlin.text.get
|
|
||||||
import kotlin.time.Duration.Companion.days
|
import kotlin.time.Duration.Companion.days
|
||||||
import kotlin.time.Duration.Companion.seconds
|
import kotlin.time.Duration.Companion.seconds
|
||||||
|
|
||||||
|
|||||||
@@ -4,12 +4,11 @@ import android.app.Application
|
|||||||
import android.content.Context
|
import android.content.Context
|
||||||
import io.github.oshai.kotlinlogging.KotlinLogging
|
import io.github.oshai.kotlinlogging.KotlinLogging
|
||||||
import suwayomi.tachidesk.manga.impl.update.IUpdater
|
import suwayomi.tachidesk.manga.impl.update.IUpdater
|
||||||
|
import suwayomi.tachidesk.server.database.H2Migration
|
||||||
import uy.kohesive.injekt.Injekt
|
import uy.kohesive.injekt.Injekt
|
||||||
import uy.kohesive.injekt.api.get
|
import uy.kohesive.injekt.api.get
|
||||||
import java.io.File
|
import java.io.File
|
||||||
import java.util.prefs.Preferences
|
import java.util.prefs.Preferences
|
||||||
import kotlin.collections.isNotEmpty
|
|
||||||
import kotlin.collections.orEmpty
|
|
||||||
|
|
||||||
private fun migratePreferences(
|
private fun migratePreferences(
|
||||||
parent: String?,
|
parent: String?,
|
||||||
@@ -76,6 +75,14 @@ private fun migrateMangaDownloadDir(applicationDirs: ApplicationDirs) {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
fun migrateH2DatabaseToV24240(applicationDirs: ApplicationDirs) {
|
||||||
|
H2Migration.migrate(
|
||||||
|
applicationDirs.dataRoot,
|
||||||
|
"1.4.200",
|
||||||
|
"2.4.240",
|
||||||
|
)
|
||||||
|
}
|
||||||
|
|
||||||
private val MIGRATIONS =
|
private val MIGRATIONS =
|
||||||
listOf<Pair<String, (ApplicationDirs) -> Unit>>(
|
listOf<Pair<String, (ApplicationDirs) -> Unit>>(
|
||||||
"InitialMigration" to { applicationDirs ->
|
"InitialMigration" to { applicationDirs ->
|
||||||
@@ -85,6 +92,9 @@ private val MIGRATIONS =
|
|||||||
"FixGlobalUpdateScheduling" to {
|
"FixGlobalUpdateScheduling" to {
|
||||||
Injekt.get<IUpdater>().deleteLastAutomatedUpdateTimestamp()
|
Injekt.get<IUpdater>().deleteLastAutomatedUpdateTimestamp()
|
||||||
},
|
},
|
||||||
|
"MigrateH2DatabaseToV2.4.240" to { applicationDirs ->
|
||||||
|
migrateH2DatabaseToV24240(applicationDirs)
|
||||||
|
},
|
||||||
)
|
)
|
||||||
|
|
||||||
fun runMigrations(applicationDirs: ApplicationDirs) {
|
fun runMigrations(applicationDirs: ApplicationDirs) {
|
||||||
|
|||||||
@@ -391,6 +391,8 @@ fun applicationSetup() {
|
|||||||
"Localization service initialized. Supported languages: ${LocalizationHelper.getSupportedLocales()}"
|
"Localization service initialized. Supported languages: ${LocalizationHelper.getSupportedLocales()}"
|
||||||
}
|
}
|
||||||
|
|
||||||
|
runMigrations(applicationDirs)
|
||||||
|
|
||||||
databaseUp()
|
databaseUp()
|
||||||
|
|
||||||
LocalSource.register()
|
LocalSource.register()
|
||||||
@@ -440,8 +442,6 @@ fun applicationSetup() {
|
|||||||
ignoreInitialValue = false,
|
ignoreInitialValue = false,
|
||||||
)
|
)
|
||||||
|
|
||||||
runMigrations(applicationDirs)
|
|
||||||
|
|
||||||
setLogLevelFor("org.eclipse.jetty", Level.OFF)
|
setLogLevelFor("org.eclipse.jetty", Level.OFF)
|
||||||
setLogLevelFor("com.zaxxer.hikari", Level.WARN)
|
setLogLevelFor("com.zaxxer.hikari", Level.WARN)
|
||||||
|
|
||||||
|
|||||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user