mirror of
https://github.com/mihonapp/mihon.git
synced 2024-11-10 12:47:26 +01:00
Fix indexing notif not showing (#8758)
This commit is contained in:
parent
593172f891
commit
235bc77457
@ -12,6 +12,8 @@ import eu.kanade.tachiyomi.source.Source
|
|||||||
import eu.kanade.tachiyomi.source.SourceManager
|
import eu.kanade.tachiyomi.source.SourceManager
|
||||||
import eu.kanade.tachiyomi.util.lang.launchIO
|
import eu.kanade.tachiyomi.util.lang.launchIO
|
||||||
import eu.kanade.tachiyomi.util.lang.launchNonCancellable
|
import eu.kanade.tachiyomi.util.lang.launchNonCancellable
|
||||||
|
import eu.kanade.tachiyomi.util.system.logcat
|
||||||
|
import kotlinx.coroutines.CancellationException
|
||||||
import kotlinx.coroutines.CoroutineScope
|
import kotlinx.coroutines.CoroutineScope
|
||||||
import kotlinx.coroutines.Dispatchers
|
import kotlinx.coroutines.Dispatchers
|
||||||
import kotlinx.coroutines.Job
|
import kotlinx.coroutines.Job
|
||||||
@ -29,6 +31,7 @@ import kotlinx.coroutines.flow.receiveAsFlow
|
|||||||
import kotlinx.coroutines.flow.shareIn
|
import kotlinx.coroutines.flow.shareIn
|
||||||
import kotlinx.coroutines.flow.stateIn
|
import kotlinx.coroutines.flow.stateIn
|
||||||
import kotlinx.coroutines.withTimeout
|
import kotlinx.coroutines.withTimeout
|
||||||
|
import logcat.LogPriority
|
||||||
import uy.kohesive.injekt.Injekt
|
import uy.kohesive.injekt.Injekt
|
||||||
import uy.kohesive.injekt.api.get
|
import uy.kohesive.injekt.api.get
|
||||||
import java.util.concurrent.ConcurrentHashMap
|
import java.util.concurrent.ConcurrentHashMap
|
||||||
@ -319,12 +322,20 @@ class DownloadCache(
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
.awaitAll()
|
.awaitAll()
|
||||||
|
}.also {
|
||||||
|
it.invokeOnCompletion(onCancelling = true) { exception ->
|
||||||
|
if (exception != null && exception !is CancellationException) {
|
||||||
|
logcat(LogPriority.ERROR, exception) { "Failed to create download cache" }
|
||||||
|
}
|
||||||
lastRenew = System.currentTimeMillis()
|
lastRenew = System.currentTimeMillis()
|
||||||
notifyChanges()
|
notifyChanges()
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Mainly to notify the indexing notifier UI
|
||||||
|
notifyChanges()
|
||||||
|
}
|
||||||
|
|
||||||
private fun getSources(): List<Source> {
|
private fun getSources(): List<Source> {
|
||||||
return sourceManager.getOnlineSources() + sourceManager.getStubSources()
|
return sourceManager.getOnlineSources() + sourceManager.getStubSources()
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user