Skip to content

Commit 738a27e

Browse files
authored
Merge pull request #3943 from Flow-Launcher/update_manifest_url_fetch
Handle MinimumAppVersion parse fail and reorder last manifest fetch date
2 parents 7208b72 + 5d297c1 commit 738a27e

File tree

1 file changed

+16
-4
lines changed

1 file changed

+16
-4
lines changed

Flow.Launcher.Core/ExternalPlugins/PluginsManifest.cs

Lines changed: 16 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -43,8 +43,6 @@ public static async Task<bool> UpdateManifestAsync(bool usePrimaryUrlOnly = fals
4343
if (results.Count == 0)
4444
return false;
4545

46-
lastFetchedAt = DateTime.Now;
47-
4846
var updatedPluginResults = new List<UserPlugin>();
4947
var appVersion = SemanticVersioning.Version.Parse(Constant.Version);
5048

@@ -56,6 +54,8 @@ public static async Task<bool> UpdateManifestAsync(bool usePrimaryUrlOnly = fals
5654

5755
UserPlugins = updatedPluginResults;
5856

57+
lastFetchedAt = DateTime.Now;
58+
5959
return true;
6060
}
6161
}
@@ -73,10 +73,22 @@ public static async Task<bool> UpdateManifestAsync(bool usePrimaryUrlOnly = fals
7373

7474
private static bool IsMinimumAppVersionSatisfied(UserPlugin plugin, SemanticVersioning.Version appVersion)
7575
{
76-
if (string.IsNullOrEmpty(plugin.MinimumAppVersion) || appVersion >= SemanticVersioning.Version.Parse(plugin.MinimumAppVersion))
76+
if (string.IsNullOrEmpty(plugin.MinimumAppVersion))
7777
return true;
7878

79-
API.LogDebug(ClassName, $"Plugin {plugin.Name} requires minimum Flow Launcher version {plugin.MinimumAppVersion}, "
79+
try
80+
{
81+
if (appVersion >= SemanticVersioning.Version.Parse(plugin.MinimumAppVersion))
82+
return true;
83+
}
84+
catch (Exception e)
85+
{
86+
API.LogException(ClassName, $"Failed to parse the minimum app version {plugin.MinimumAppVersion} for plugin {plugin.Name}. "
87+
+ "Plugin excluded from manifest", e);
88+
return false;
89+
}
90+
91+
API.LogInfo(ClassName, $"Plugin {plugin.Name} requires minimum Flow Launcher version {plugin.MinimumAppVersion}, "
8092
+ $"but current version is {Constant.Version}. Plugin excluded from manifest.");
8193

8294
return false;

0 commit comments

Comments
 (0)