Subscriptions!

This commit is contained in:
Valter Martinek
2022-11-11 22:56:14 +01:00
committed by Syer10
parent e2fa003239
commit 847a5fe71b
20 changed files with 658 additions and 77 deletions

View File

@@ -24,6 +24,7 @@ import mu.KotlinLogging
import org.jetbrains.exposed.sql.and
import org.jetbrains.exposed.sql.select
import org.jetbrains.exposed.sql.transactions.transaction
import suwayomi.tachidesk.graphql.subscriptions.downloadSubscriptionSource
import suwayomi.tachidesk.manga.impl.download.model.DownloadChapter
import suwayomi.tachidesk.manga.impl.download.model.DownloadState.Downloading
import suwayomi.tachidesk.manga.impl.download.model.DownloadStatus
@@ -100,6 +101,9 @@ object DownloadManager {
notifyFlow.emit(Unit)
}
}
/*if (downloadChapter != null) { TODO GRAPHQL
downloadSubscriptionSource.publish(downloadChapter)
}*/
}
private fun getStatus(): DownloadStatus {
@@ -234,6 +238,7 @@ object DownloadManager {
manga
)
downloadQueue.add(downloadChapter)
downloadSubscriptionSource.publish(downloadChapter)
logger.debug { "Added chapter ${chapter.id} to download queue (${manga.title} | ${chapter.name})" }
return downloadChapter
}