Minor cleanups

Pulling out some of the smaller changes that aren't related to the manga controller changes in #7244
This commit is contained in:
arkon
2022-06-04 16:01:49 -04:00
parent 5ea03fad87
commit 7fdbf40cd2
25 changed files with 94 additions and 79 deletions
@@ -102,8 +102,9 @@ class DownloadManager(
downloader.clearQueue(isNotification)
}
fun startDownloadNow(chapter: Chapter) {
val download = downloader.queue.find { it.chapter.id == chapter.id } ?: return
fun startDownloadNow(chapterId: Long?) {
if (chapterId == null) return
val download = downloader.queue.find { it.chapter.id == chapterId } ?: return
val queue = downloader.queue.toMutableList()
queue.remove(download)
queue.add(0, download)
@@ -6,9 +6,12 @@ import eu.kanade.tachiyomi.source.model.Page
import eu.kanade.tachiyomi.source.online.HttpSource
import rx.subjects.PublishSubject
class Download(val source: HttpSource, val manga: Manga, val chapter: Chapter) {
var pages: List<Page>? = null
data class Download(
val source: HttpSource,
val manga: Manga,
val chapter: Chapter,
var pages: List<Page>? = null,
) {
@Volatile
@Transient