mirror of
https://github.com/MindWorkAI/AI-Studio.git
synced 2026-10-06 01:09:40 +00:00
Add German localization (#430)
Build and Release / Read metadata (push) Waiting to run
Build and Release / Build app (${{ matrix.dotnet_runtime }}) (-aarch64-apple-darwin, osx-arm64, macos-latest, aarch64-apple-darwin, dmg updater) (push) Blocked by required conditions
Build and Release / Build app (${{ matrix.dotnet_runtime }}) (-aarch64-pc-windows-msvc.exe, win-arm64, windows-latest, aarch64-pc-windows-msvc, nsis updater) (push) Blocked by required conditions
Build and Release / Build app (${{ matrix.dotnet_runtime }}) (-aarch64-unknown-linux-gnu, linux-arm64, ubuntu-22.04-arm, aarch64-unknown-linux-gnu, appimage deb updater) (push) Blocked by required conditions
Build and Release / Build app (${{ matrix.dotnet_runtime }}) (-x86_64-apple-darwin, osx-x64, macos-latest, x86_64-apple-darwin, dmg updater) (push) Blocked by required conditions
Build and Release / Build app (${{ matrix.dotnet_runtime }}) (-x86_64-pc-windows-msvc.exe, win-x64, windows-latest, x86_64-pc-windows-msvc, nsis updater) (push) Blocked by required conditions
Build and Release / Build app (${{ matrix.dotnet_runtime }}) (-x86_64-unknown-linux-gnu, linux-x64, ubuntu-22.04, x86_64-unknown-linux-gnu, appimage deb updater) (push) Blocked by required conditions
Build and Release / Prepare & create release (push) Blocked by required conditions
Build and Release / Publish release (push) Blocked by required conditions
Build and Release / Read metadata (push) Waiting to run
Build and Release / Build app (${{ matrix.dotnet_runtime }}) (-aarch64-apple-darwin, osx-arm64, macos-latest, aarch64-apple-darwin, dmg updater) (push) Blocked by required conditions
Build and Release / Build app (${{ matrix.dotnet_runtime }}) (-aarch64-pc-windows-msvc.exe, win-arm64, windows-latest, aarch64-pc-windows-msvc, nsis updater) (push) Blocked by required conditions
Build and Release / Build app (${{ matrix.dotnet_runtime }}) (-aarch64-unknown-linux-gnu, linux-arm64, ubuntu-22.04-arm, aarch64-unknown-linux-gnu, appimage deb updater) (push) Blocked by required conditions
Build and Release / Build app (${{ matrix.dotnet_runtime }}) (-x86_64-apple-darwin, osx-x64, macos-latest, x86_64-apple-darwin, dmg updater) (push) Blocked by required conditions
Build and Release / Build app (${{ matrix.dotnet_runtime }}) (-x86_64-pc-windows-msvc.exe, win-x64, windows-latest, x86_64-pc-windows-msvc, nsis updater) (push) Blocked by required conditions
Build and Release / Build app (${{ matrix.dotnet_runtime }}) (-x86_64-unknown-linux-gnu, linux-x64, ubuntu-22.04, x86_64-unknown-linux-gnu, appimage deb updater) (push) Blocked by required conditions
Build and Release / Prepare & create release (push) Blocked by required conditions
Build and Release / Publish release (push) Blocked by required conditions
This commit is contained in:
1 parent
2494ee2294
commit
47b6a89685
44 files changed
+3394
-262
No files matched your search
@@ -55,39 +55,54 @@ public static partial class PluginFactory
|
||||
var pluginMainFiles = Directory.EnumerateFiles(PLUGINS_ROOT, "plugin.lua", SearchOption.AllDirectories);
|
||||
foreach (var pluginMainFile in pluginMainFiles)
|
||||
{
|
||||
if (cancellationToken.IsCancellationRequested)
|
||||
break;
|
||||
|
||||
LOG.LogInformation($"Try to load plugin: {pluginMainFile}");
|
||||
var code = await File.ReadAllTextAsync(pluginMainFile, Encoding.UTF8, cancellationToken);
|
||||
var pluginPath = Path.GetDirectoryName(pluginMainFile)!;
|
||||
var plugin = await Load(pluginPath, code, cancellationToken);
|
||||
|
||||
switch (plugin)
|
||||
try
|
||||
{
|
||||
case NoPlugin noPlugin when noPlugin.Issues.Any():
|
||||
LOG.LogError($"Was not able to load plugin: '{pluginMainFile}'. Reason: {noPlugin.Issues.First()}");
|
||||
continue;
|
||||
|
||||
case NoPlugin:
|
||||
LOG.LogError($"Was not able to load plugin: '{pluginMainFile}'. Reason: Unknown.");
|
||||
continue;
|
||||
|
||||
case { IsValid: false }:
|
||||
LOG.LogError($"Was not able to load plugin '{pluginMainFile}', because the Lua code is not a valid AI Studio plugin. There are {plugin.Issues.Count()} issues to fix. First issue is: {plugin.Issues.FirstOrDefault()}");
|
||||
#if DEBUG
|
||||
foreach (var pluginIssue in plugin.Issues)
|
||||
LOG.LogError($"Plugin issue: {pluginIssue}");
|
||||
#endif
|
||||
continue;
|
||||
|
||||
case { IsMaintained: false }:
|
||||
LOG.LogWarning($"The plugin '{pluginMainFile}' is not maintained anymore. Please consider to disable it.");
|
||||
if (cancellationToken.IsCancellationRequested)
|
||||
break;
|
||||
}
|
||||
|
||||
LOG.LogInformation($"Successfully loaded plugin: '{pluginMainFile}' (Id='{plugin.Id}', Type='{plugin.Type}', Name='{plugin.Name}', Version='{plugin.Version}', Authors='{string.Join(", ", plugin.Authors)}')");
|
||||
AVAILABLE_PLUGINS.Add(new PluginMetadata(plugin, pluginPath));
|
||||
LOG.LogInformation($"Try to load plugin: {pluginMainFile}");
|
||||
var fileInfo = new FileInfo(pluginMainFile);
|
||||
string code;
|
||||
await using(var fileStream = fileInfo.Open(FileMode.Open, FileAccess.Read, FileShare.ReadWrite))
|
||||
{
|
||||
using var reader = new StreamReader(fileStream, Encoding.UTF8);
|
||||
code = await reader.ReadToEndAsync(cancellationToken);
|
||||
}
|
||||
|
||||
var pluginPath = Path.GetDirectoryName(pluginMainFile)!;
|
||||
var plugin = await Load(pluginPath, code, cancellationToken);
|
||||
|
||||
switch (plugin)
|
||||
{
|
||||
case NoPlugin noPlugin when noPlugin.Issues.Any():
|
||||
LOG.LogError($"Was not able to load plugin: '{pluginMainFile}'. Reason: {noPlugin.Issues.First()}");
|
||||
continue;
|
||||
|
||||
case NoPlugin:
|
||||
LOG.LogError($"Was not able to load plugin: '{pluginMainFile}'. Reason: Unknown.");
|
||||
continue;
|
||||
|
||||
case { IsValid: false }:
|
||||
LOG.LogError($"Was not able to load plugin '{pluginMainFile}', because the Lua code is not a valid AI Studio plugin. There are {plugin.Issues.Count()} issues to fix. First issue is: {plugin.Issues.FirstOrDefault()}");
|
||||
#if DEBUG
|
||||
foreach (var pluginIssue in plugin.Issues)
|
||||
LOG.LogError($"Plugin issue: {pluginIssue}");
|
||||
#endif
|
||||
continue;
|
||||
|
||||
case { IsMaintained: false }:
|
||||
LOG.LogWarning($"The plugin '{pluginMainFile}' is not maintained anymore. Please consider to disable it.");
|
||||
break;
|
||||
}
|
||||
|
||||
LOG.LogInformation($"Successfully loaded plugin: '{pluginMainFile}' (Id='{plugin.Id}', Type='{plugin.Type}', Name='{plugin.Name}', Version='{plugin.Version}', Authors='{string.Join(", ", plugin.Authors)}')");
|
||||
AVAILABLE_PLUGINS.Add(new PluginMetadata(plugin, pluginPath));
|
||||
}
|
||||
catch (Exception e)
|
||||
{
|
||||
LOG.LogError($"Was not able to load plugin '{pluginMainFile}'. Issue: {e.Message}");
|
||||
LOG.LogDebug(e.StackTrace);
|
||||
}
|
||||
}
|
||||
|
||||
// Start or restart all plugins:
|
||||
|
||||
Reference in new issue
Block a user