From 4b21eea285935b001dbf12f2c4644f9b2ac00cb0 Mon Sep 17 00:00:00 2001 From: kodjomoustapha <107993382+kodjodevf@users.noreply.github.com> Date: Thu, 21 Nov 2024 10:45:18 +0100 Subject: [PATCH] fix --- lib/services/fetch_sources_list.dart | 15 ++++++++------- 1 file changed, 8 insertions(+), 7 deletions(-) diff --git a/lib/services/fetch_sources_list.dart b/lib/services/fetch_sources_list.dart index 668d7f6..933e86a 100644 --- a/lib/services/fetch_sources_list.dart +++ b/lib/services/fetch_sources_list.dart @@ -55,7 +55,8 @@ Future fetchSourcesList( ..isFullData = source.isFullData ?? false ..appMinVerReq = source.appMinVerReq ..sourceCodeLanguage = source.sourceCodeLanguage - ..additionalParams = source.additionalParams ?? ""); + ..additionalParams = source.additionalParams ?? "" + ..isObsolete = false); }); // log("successfully installed or updated"); } @@ -93,7 +94,8 @@ Future fetchSourcesList( ..isFullData = source.isFullData ?? false ..appMinVerReq = source.appMinVerReq ..sourceCodeLanguage = source.sourceCodeLanguage - ..additionalParams = source.additionalParams ?? ""); + ..additionalParams = source.additionalParams ?? "" + ..isObsolete = false); }); } else { // log("update aivalable"); @@ -121,7 +123,8 @@ Future fetchSourcesList( ..isManga = source.isManga ..sourceCodeLanguage = source.sourceCodeLanguage ..isFullData = source.isFullData ?? false - ..appMinVerReq = source.appMinVerReq); + ..appMinVerReq = source.appMinVerReq + ..isObsolete = false); // log("new source"); } } @@ -142,10 +145,8 @@ void checkIfSourceIsObsolete(List sourceList, bool isManga) { final ids = sourceList.where((e) => e.id != null).map((e) => e.id).toList(); if (ids.isNotEmpty) { - if (!ids.contains(source.id)) { - isar.writeTxnSync( - () => isar.sources.putSync(source..isObsolete = true)); - } + isar.writeTxnSync(() => isar.sources + .putSync(source..isObsolete = !ids.contains(source.id))); } } }