diff --git a/app/MindWork AI Studio/Tools/Services/PluginShareResult.cs b/app/MindWork AI Studio/Tools/Services/PluginShareResult.cs new file mode 100644 index 00000000..dcf1ada8 --- /dev/null +++ b/app/MindWork AI Studio/Tools/Services/PluginShareResult.cs @@ -0,0 +1,3 @@ +namespace AIStudio.Tools.Services; + +public sealed record PluginShareResult(bool Success, string PluginName, string ArchivePath, string Issue, bool Cancelled = false); \ No newline at end of file diff --git a/app/MindWork AI Studio/Tools/Services/PluginShareService.cs b/app/MindWork AI Studio/Tools/Services/PluginShareService.cs index 344709fc..4e2b4abf 100644 --- a/app/MindWork AI Studio/Tools/Services/PluginShareService.cs +++ b/app/MindWork AI Studio/Tools/Services/PluginShareService.cs @@ -4,21 +4,18 @@ using AIStudio.Tools.Rust; namespace AIStudio.Tools.Services; -public sealed record PluginShareResult(bool Success, string PluginName, string ArchivePath, string Issue, bool Cancelled = false); - public sealed class PluginShareService(NativeShareService nativeShareService, RustService rustService, ILogger logger) { private static PluginShareResult ShareError(IAvailablePlugin plugin, string issue) => new(false, plugin.Name, string.Empty, issue); + private static string TB(string fallbackEN) => I18N.I.T(fallbackEN, typeof(PluginShareService).Namespace, nameof(PluginShareService)); public const string PLUGIN_FILE_EXTENSION = ".mwplugin"; - private const string PLUGIN_FILE_NAME = "plugin.lua"; private const string TEMPORARY_ARCHIVE_DIRECTORY = "mindwork-ai-studio-plugin-shares"; private const int TEMPORARY_ARCHIVE_RETENTION_HOURS = 24; private const int FILE_NAME_PREFIX_MAX_LEN = 80; - /// /// Creates a shareable plugin archive from a local plugin and hands it over to the user. /// The archive contains the plugin root contents, so plugin.lua is located at the archive root. @@ -233,4 +230,4 @@ public sealed class PluginShareService(NativeShareService nativeShareService, Ru logger.LogWarning(exception, "Failed to delete temporary plugin archive '{ArchivePath}'.", archivePath); } } -} +} \ No newline at end of file