mirror of
https://github.com/mihonapp/mihon.git
synced 2026-10-16 13:48:09 -07:00
Fix stored stub sources not loading and being rewritten on every reload
Stub sources loaded from the database were written into a throwaway copy of the map, so they never reached the source manager. StubSource also becomes a data class, so a stored one compares equal to the same source again and isn't rewritten on every reload.
This commit is contained in:
@@ -66,9 +66,8 @@ class AndroidSourceManager(
|
||||
scope.launch {
|
||||
sourceRepository.subscribeAll()
|
||||
.collectLatest { sources ->
|
||||
val mutableMap = stubSourcesMap.toMutableMap()
|
||||
sources.forEach {
|
||||
mutableMap[it.id] = it
|
||||
stubSourcesMap[it.id] = it
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -8,7 +8,7 @@ import eu.kanade.tachiyomi.source.model.SChapter
|
||||
import eu.kanade.tachiyomi.source.model.SManga
|
||||
import eu.kanade.tachiyomi.source.model.SMangaUpdate
|
||||
|
||||
class StubSource(
|
||||
data class StubSource(
|
||||
override val id: Long,
|
||||
override val lang: String,
|
||||
override val name: String,
|
||||
|
||||
Reference in New Issue
Block a user