mirror of
https://github.com/kodjodevf/mangayomi.git
synced 2026-03-11 17:25:32 +00:00
fixed other repos marked as obsolete when using multiple repos
This commit is contained in:
parent
dec2968921
commit
972d3ca218
1 changed files with 8 additions and 4 deletions
|
|
@ -158,11 +158,11 @@ Future<void> fetchSourcesList(
|
|||
}
|
||||
}
|
||||
});
|
||||
checkIfSourceIsObsolete(sourceList, itemType, ref);
|
||||
checkIfSourceIsObsolete(sourceList, repo!, itemType, ref);
|
||||
}
|
||||
|
||||
void checkIfSourceIsObsolete(
|
||||
List<Source> sourceList, ItemType itemType, Ref ref) {
|
||||
List<Source> sourceList, Repo repo, ItemType itemType, Ref ref) {
|
||||
for (var source in isar.sources
|
||||
.filter()
|
||||
.idIsNotNull()
|
||||
|
|
@ -173,11 +173,15 @@ void checkIfSourceIsObsolete(
|
|||
sourceList.where((e) => e.id != null).map((e) => e.id).toList();
|
||||
if (ids.isNotEmpty) {
|
||||
isar.writeTxnSync(() {
|
||||
if (source.isObsolete != !ids.contains(source.id)) {
|
||||
if (source.isObsolete !=
|
||||
(!ids.contains(source.id) &&
|
||||
source.repo?.jsonUrl == repo.jsonUrl)) {
|
||||
ref.read(synchingProvider(syncId: 1).notifier).addChangedPart(
|
||||
ActionType.updateExtension, source.id, source.toJson(), false);
|
||||
}
|
||||
isar.sources.putSync(source..isObsolete = !ids.contains(source.id));
|
||||
isar.sources.putSync(source
|
||||
..isObsolete = !ids.contains(source.id) &&
|
||||
source.repo?.jsonUrl == repo.jsonUrl);
|
||||
});
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in a new issue