Commit 0d756a7 1 parent db62c9f commit 0d756a7 Copy full SHA for 0d756a7
File tree 1 file changed +11
-0
lines changed
server/src/main/kotlin/suwayomi/tachidesk/manga/impl/download
1 file changed +11
-0
lines changed Original file line number Diff line number Diff line change @@ -297,6 +297,8 @@ object DownloadManager {
297
297
}
298
298
299
299
private fun dequeue (chapterDownloads : Set <DownloadChapter >) {
300
+ logger.debug { " dequeue ${chapterDownloads.size} chapters [${chapterDownloads.joinToString(separator = " , " ) { " ${it.manga.title} (${it.mangaId} ) - ${it.chapter.name} (${it.chapter.id} )" }} ]" }
301
+
300
302
downloadQueue.removeAll(chapterDownloads)
301
303
saveDownloadQueue()
302
304
@@ -307,18 +309,25 @@ object DownloadManager {
307
309
require(to >= 0 ) { " 'to' must be over or equal to 0" }
308
310
val download = downloadQueue.find { it.mangaId == mangaId && it.chapterIndex == chapterIndex }
309
311
? : return
312
+
313
+ logger.debug { " reorder download ${download.manga.title} (${download.mangaId} ) - ${download.chapter.name} (${download.chapter.id} )" }
314
+
310
315
downloadQueue - = download
311
316
downloadQueue.add(to, download)
312
317
saveDownloadQueue()
313
318
}
314
319
315
320
fun start () {
321
+ logger.debug { " start" }
322
+
316
323
scope.launch {
317
324
downloaderWatch.emit(Unit )
318
325
}
319
326
}
320
327
321
328
suspend fun stop () {
329
+ logger.debug { " stop" }
330
+
322
331
coroutineScope {
323
332
downloaders.map { (_, downloader) ->
324
333
async {
@@ -330,6 +339,8 @@ object DownloadManager {
330
339
}
331
340
332
341
suspend fun clear () {
342
+ logger.debug { " clear" }
343
+
333
344
stop()
334
345
downloadQueue.clear()
335
346
saveDownloadQueue()
You can’t perform that action at this time.
0 commit comments