From 86b25590c7eb3064fc596816f60f906519c08458 Mon Sep 17 00:00:00 2001 From: Ben Chatelain Date: Sat, 17 Feb 2024 14:03:44 -0700 Subject: [PATCH] =?UTF-8?q?=F0=9F=A9=B9=20Fix=20merge=20mistakes?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../MasKit/Controllers/MasStoreSearch.swift | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/Sources/MasKit/Controllers/MasStoreSearch.swift b/Sources/MasKit/Controllers/MasStoreSearch.swift index 38976bbc4..3875a89e4 100644 --- a/Sources/MasKit/Controllers/MasStoreSearch.swift +++ b/Sources/MasKit/Controllers/MasStoreSearch.swift @@ -112,20 +112,20 @@ class MasStoreSearch: StoreSearch { return firstly { self.scrapeAppStoreVersion(pageUrl) }.map { pageVersion in - guard let pageVersion = pageVersion, + guard let pageVersion, let searchVersion = Version(tolerant: result.version), pageVersion > searchVersion else { - return nil + return result } - return firstly { - self.scrapeVersionFromPage(pageUrl) - }.done { pageVersion in - if let pageVersion, pageVersion > searchVersion { - results[index].version = pageVersion.description - } - } + // Update the search result with the version from the App Store page. + var result = result + result.version = pageVersion.description + return result + }.recover { _ in + // If we were unable to scrape the App Store page, assume compatibility. + .value(result) } } }