Cleanup and fix a few compiler warnings

This commit is contained in:
Jobobby04
2020-09-13 22:03:27 -04:00
parent 73523dbff8
commit 02e6eaae12
24 changed files with 50 additions and 62 deletions
@@ -34,6 +34,8 @@ import kotlin.time.days
import kotlin.time.hours
import kotlinx.coroutines.CoroutineScope
import kotlinx.coroutines.Dispatchers
import kotlinx.coroutines.ExperimentalCoroutinesApi
import kotlinx.coroutines.FlowPreview
import kotlinx.coroutines.Job
import kotlinx.coroutines.cancelAndJoin
import kotlinx.coroutines.flow.asFlow
@@ -128,6 +130,7 @@ class EHentaiUpdateWorker : JobService(), CoroutineScope {
return true
}
@OptIn(FlowPreview::class)
private suspend fun startUpdating() {
logger.d("Update job started!")
val startTime = System.currentTimeMillis()
@@ -255,6 +258,7 @@ class EHentaiUpdateWorker : JobService(), CoroutineScope {
}
// New, current
@OptIn(ExperimentalCoroutinesApi::class)
private suspend fun updateEntryAndGetChapters(manga: Manga): Pair<List<Chapter>, List<Chapter>> {
val source = sourceManager.get(manga.source) as? EHentai
?: throw GalleryNotUpdatedException(false, IllegalStateException("Missing EH-based source (${manga.source})!"))