Updated Logger. Local plugin database has now only executable dependencies stored in the database

This commit is contained in:
2024-07-01 13:07:34 +03:00
parent fa7e7988d5
commit 9b563cc0f6
10 changed files with 33 additions and 22 deletions

View File

@@ -8,12 +8,14 @@ public class OnlineDependencyInfo
public string DependencyName { get; private set; }
public string DownloadLink { get; private set; }
public string DownloadLocation { get; private set; }
public bool IsExecutable { get; private set; }
[JsonConstructor]
public OnlineDependencyInfo(string dependencyName, string downloadLink, string downloadLocation)
public OnlineDependencyInfo(string dependencyName, string downloadLink, string downloadLocation, bool isExecutable)
{
DependencyName = dependencyName;
DownloadLink = downloadLink;
DownloadLocation = downloadLocation;
IsExecutable = isExecutable;
}
}

View File

@@ -1,4 +1,3 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text.Json.Serialization;
@@ -37,6 +36,11 @@ public class PluginInfo
public static PluginInfo FromOnlineInfo(PluginOnlineInfo onlineInfo)
{
return new PluginInfo(onlineInfo.Name, onlineInfo.Version, onlineInfo.Dependencies.Select(dep => new KeyValuePair<string, string>(dep.DependencyName, dep.DownloadLocation)).ToDictionary());
return new PluginInfo(onlineInfo.Name,
onlineInfo.Version,
onlineInfo.Dependencies
.Where(dep => dep.IsExecutable)
.Select(dep => new KeyValuePair<string, string>(dep.DependencyName, dep.DownloadLocation))
.ToDictionary());
}
}