From 972d3ca218647e0dc7629eed37ee9caae9c58bd9 Mon Sep 17 00:00:00 2001 From: Schnitzel5 Date: Sat, 15 Feb 2025 18:18:07 +0100 Subject: [PATCH] fixed other repos marked as obsolete when using multiple repos --- lib/services/fetch_sources_list.dart | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/lib/services/fetch_sources_list.dart b/lib/services/fetch_sources_list.dart index 3a08eda4..368eb63f 100644 --- a/lib/services/fetch_sources_list.dart +++ b/lib/services/fetch_sources_list.dart @@ -158,11 +158,11 @@ Future fetchSourcesList( } } }); - checkIfSourceIsObsolete(sourceList, itemType, ref); + checkIfSourceIsObsolete(sourceList, repo!, itemType, ref); } void checkIfSourceIsObsolete( - List sourceList, ItemType itemType, Ref ref) { + List 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); }); } }