mirror of
https://github.com/Suwayomi/Suwayomi-Server.git
synced 2026-07-10 14:24:34 -05:00
Feature/Improve chapter download with valid existing download handling (#1553)
* Fix early exit on download for existing download for FolderProvider The current check only worked for the "ArchiveProvider". The "FolderProvider" never moved the existing download to the cache folder. In case the existing download is considered to be reusable, there is no need to proceed with the download logic. * Fix "ArchiveProvider#extractExistingDownload" The "ChaptersFilesProvider#extractExistingDownload" expects the download to be extracted into the final download folder. However, the "ArchiveProvider" extracted the download into the chapter download cache folder. * Add chapter download function call requirements
This commit is contained in:
@@ -2,6 +2,7 @@ package suwayomi.tachidesk.manga.impl
|
||||
|
||||
import kotlinx.coroutines.CoroutineScope
|
||||
import org.jetbrains.exposed.sql.transactions.transaction
|
||||
import suwayomi.tachidesk.manga.impl.chapter.getChapterDownloadReady
|
||||
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.FolderProvider
|
||||
@@ -32,6 +33,9 @@ object ChapterDownloadHelper {
|
||||
chapterId: Int,
|
||||
): Boolean = provider(mangaId, chapterId).delete()
|
||||
|
||||
/**
|
||||
* This function should never be called without calling [getChapterDownloadReady] beforehand.
|
||||
*/
|
||||
suspend fun download(
|
||||
mangaId: Int,
|
||||
chapterId: Int,
|
||||
|
||||
Reference in New Issue
Block a user