mirror of
https://github.com/Suwayomi/Suwayomi-Server.git
synced 2026-07-15 00:34:12 -05:00
Lint (#423)
This commit is contained in:
@@ -49,7 +49,8 @@ object DownloadManager {
|
||||
|Supported commands are:
|
||||
| - STATUS
|
||||
| sends the current download status
|
||||
|""".trimMargin()
|
||||
|
|
||||
""".trimMargin()
|
||||
)
|
||||
}
|
||||
}
|
||||
@@ -65,7 +66,11 @@ object DownloadManager {
|
||||
return DownloadStatus(
|
||||
if (downloader == null ||
|
||||
downloadQueue.none { it.state == Downloading }
|
||||
) "Stopped" else "Started",
|
||||
) {
|
||||
"Stopped"
|
||||
} else {
|
||||
"Started"
|
||||
},
|
||||
downloadQueue
|
||||
)
|
||||
}
|
||||
@@ -96,8 +101,10 @@ object DownloadManager {
|
||||
}
|
||||
|
||||
fun start() {
|
||||
if (downloader != null && !downloader?.isAlive!!) // doesn't exist or is dead
|
||||
if (downloader != null && !downloader?.isAlive!!) {
|
||||
// doesn't exist or is dead
|
||||
downloader = null
|
||||
}
|
||||
|
||||
if (downloader == null) {
|
||||
downloader = Downloader(downloadQueue) { notifyAllClients() }
|
||||
@@ -127,5 +134,5 @@ object DownloadManager {
|
||||
enum class DownloaderState(val state: Int) {
|
||||
Stopped(0),
|
||||
Running(1),
|
||||
Paused(2),
|
||||
Paused(2)
|
||||
}
|
||||
|
||||
@@ -18,5 +18,5 @@ class DownloadChapter(
|
||||
var manga: MangaDataClass,
|
||||
var state: DownloadState = Queued,
|
||||
var progress: Float = 0f,
|
||||
var tries: Int = 0,
|
||||
var tries: Int = 0
|
||||
)
|
||||
|
||||
@@ -11,5 +11,5 @@ enum class DownloadState(val state: Int) {
|
||||
Queued(0),
|
||||
Downloading(1),
|
||||
Finished(2),
|
||||
Error(3),
|
||||
Error(3)
|
||||
}
|
||||
|
||||
@@ -9,5 +9,5 @@ package suwayomi.tachidesk.manga.impl.download.model
|
||||
|
||||
data class DownloadStatus(
|
||||
val status: String,
|
||||
val queue: List<DownloadChapter>,
|
||||
val queue: List<DownloadChapter>
|
||||
)
|
||||
|
||||
Reference in New Issue
Block a user