mirror of
https://github.com/JustArchiNET/ArchiSteamFarm.git
synced 2026-01-06 17:10:13 +00:00
Add GET /Api/Plugins endpoint,
In regards to https://github.com/JustArchiNET/ASF-ui/issues/1015
This commit is contained in:
@@ -21,6 +21,7 @@
|
||||
|
||||
using System;
|
||||
using JetBrains.Annotations;
|
||||
using Newtonsoft.Json;
|
||||
|
||||
namespace ArchiSteamFarm.Plugins {
|
||||
[PublicAPI]
|
||||
@@ -29,6 +30,7 @@ namespace ArchiSteamFarm.Plugins {
|
||||
/// ASF will use this property as general plugin identifier for the user.
|
||||
/// </summary>
|
||||
/// <returns>String that will be used as the name of this plugin.</returns>
|
||||
[JsonProperty]
|
||||
[NotNull]
|
||||
string Name { get; }
|
||||
|
||||
@@ -37,6 +39,7 @@ namespace ArchiSteamFarm.Plugins {
|
||||
/// You have a freedom in deciding what versioning you want to use, this is for identification purposes only.
|
||||
/// </summary>
|
||||
/// <returns>Version that will be shown to the user when plugin is loaded.</returns>
|
||||
[JsonProperty]
|
||||
[NotNull]
|
||||
Version Version { get; }
|
||||
|
||||
|
||||
@@ -39,10 +39,10 @@ namespace ArchiSteamFarm.Plugins {
|
||||
internal static class PluginsCore {
|
||||
internal static bool HasCustomPluginsLoaded => HasActivePluginsLoaded && ActivePlugins.Any(plugin => !(plugin is OfficialPlugin officialPlugin) || !officialPlugin.HasSameVersion());
|
||||
|
||||
private static bool HasActivePluginsLoaded => ActivePlugins?.Count > 0;
|
||||
|
||||
[ImportMany]
|
||||
private static ImmutableHashSet<IPlugin> ActivePlugins { get; set; }
|
||||
internal static ImmutableHashSet<IPlugin> ActivePlugins { get; private set; }
|
||||
|
||||
private static bool HasActivePluginsLoaded => ActivePlugins?.Count > 0;
|
||||
|
||||
[ItemNotNull]
|
||||
internal static async Task<StringComparer> GetBotsComparer() {
|
||||
|
||||
Reference in New Issue
Block a user