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 {
|
scope.launch {
|
||||||
sourceRepository.subscribeAll()
|
sourceRepository.subscribeAll()
|
||||||
.collectLatest { sources ->
|
.collectLatest { sources ->
|
||||||
val mutableMap = stubSourcesMap.toMutableMap()
|
|
||||||
sources.forEach {
|
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.SManga
|
||||||
import eu.kanade.tachiyomi.source.model.SMangaUpdate
|
import eu.kanade.tachiyomi.source.model.SMangaUpdate
|
||||||
|
|
||||||
class StubSource(
|
data class StubSource(
|
||||||
override val id: Long,
|
override val id: Long,
|
||||||
override val lang: String,
|
override val lang: String,
|
||||||
override val name: String,
|
override val name: String,
|
||||||
|
|||||||
Reference in New Issue
Block a user