mirror of
https://github.com/Flow-Launcher/Flow.Launcher.git
synced 2026-03-11 08:54:32 +00:00
31 lines
No EOL
1.1 KiB
C#
31 lines
No EOL
1.1 KiB
C#
using Flow.Launcher.Infrastructure.Http;
|
|
using Flow.Launcher.Infrastructure.Logger;
|
|
using System;
|
|
using System.Collections.Generic;
|
|
using System.Text.Json;
|
|
using System.Threading.Tasks;
|
|
|
|
namespace Flow.Launcher.Plugin.PluginsManager.Models
|
|
{
|
|
internal class PluginsManifest
|
|
{
|
|
internal List<UserPlugin> UserPlugins { get; private set; } = new List<UserPlugin>();
|
|
|
|
internal async Task DownloadManifest()
|
|
{
|
|
try
|
|
{
|
|
await using var jsonStream = await Http.GetStreamAsync("https://raw.githubusercontent.com/Flow-Launcher/Flow.Launcher.PluginsManifest/main/plugins.json")
|
|
.ConfigureAwait(false);
|
|
|
|
UserPlugins = await JsonSerializer.DeserializeAsync<List<UserPlugin>>(jsonStream).ConfigureAwait(false);
|
|
}
|
|
catch (Exception e)
|
|
{
|
|
Log.Exception("|PluginManagement.GetManifest|Encountered error trying to download plugins manifest", e);
|
|
|
|
UserPlugins = new List<UserPlugin>();
|
|
}
|
|
}
|
|
}
|
|
} |