Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
20 changes: 16 additions & 4 deletions Flow.Launcher.Core/ExternalPlugins/PluginsManifest.cs
Original file line number Diff line number Diff line change
Expand Up @@ -43,8 +43,6 @@ public static async Task<bool> UpdateManifestAsync(bool usePrimaryUrlOnly = fals
if (results.Count == 0)
return false;

lastFetchedAt = DateTime.Now;

var updatedPluginResults = new List<UserPlugin>();
var appVersion = SemanticVersioning.Version.Parse(Constant.Version);

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

UserPlugins = updatedPluginResults;

lastFetchedAt = DateTime.Now;

return true;
}
}
Expand All @@ -73,10 +73,22 @@ public static async Task<bool> UpdateManifestAsync(bool usePrimaryUrlOnly = fals

private static bool IsMinimumAppVersionSatisfied(UserPlugin plugin, SemanticVersioning.Version appVersion)
{
if (string.IsNullOrEmpty(plugin.MinimumAppVersion) || appVersion >= SemanticVersioning.Version.Parse(plugin.MinimumAppVersion))
if (string.IsNullOrEmpty(plugin.MinimumAppVersion))
return true;

API.LogDebug(ClassName, $"Plugin {plugin.Name} requires minimum Flow Launcher version {plugin.MinimumAppVersion}, "
try
{
if (appVersion >= SemanticVersioning.Version.Parse(plugin.MinimumAppVersion))
return true;
}
catch (Exception e)
{
API.LogException(ClassName, $"Failed to parse the minimum app version {plugin.MinimumAppVersion} for plugin {plugin.Name}. "
+ "Plugin excluded from manifest", e);
return false;
}

API.LogInfo(ClassName, $"Plugin {plugin.Name} requires minimum Flow Launcher version {plugin.MinimumAppVersion}, "
+ $"but current version is {Constant.Version}. Plugin excluded from manifest.");

return false;
Expand Down
Loading