From f72eef2b95fa463e525ddc824f0f0c30aa22a73f Mon Sep 17 00:00:00 2001 From: Thorsten Sommer Date: Sun, 23 Mar 2025 14:26:47 +0100 Subject: [PATCH] Refactored DEPRECATION_MESSAGE to use an empty string when not needed --- .../de-de-43065dbc-78d0-45b7-92be-f14c2926e2dc/plugin.lua | 4 +++- .../en-us-97dfb1ba-50c4-4440-8dfa-6575daf543c8/plugin.lua | 2 +- .../Tools/PluginSystem/IPluginMetadata.cs | 2 +- app/MindWork AI Studio/Tools/PluginSystem/PluginBase.cs | 8 ++++---- .../Tools/PluginSystem/PluginMetadata.cs | 2 +- 5 files changed, 10 insertions(+), 8 deletions(-) diff --git a/app/MindWork AI Studio/Plugins/languages/de-de-43065dbc-78d0-45b7-92be-f14c2926e2dc/plugin.lua b/app/MindWork AI Studio/Plugins/languages/de-de-43065dbc-78d0-45b7-92be-f14c2926e2dc/plugin.lua index 4801b782..dfcd508d 100644 --- a/app/MindWork AI Studio/Plugins/languages/de-de-43065dbc-78d0-45b7-92be-f14c2926e2dc/plugin.lua +++ b/app/MindWork AI Studio/Plugins/languages/de-de-43065dbc-78d0-45b7-92be-f14c2926e2dc/plugin.lua @@ -1,3 +1,5 @@ +require("contentHome") + -- The ID for this plugin: ID = "43065dbc-78d0-45b7-92be-f14c2926e2dc" @@ -32,7 +34,7 @@ TARGET_GROUPS = { "EVERYONE" } IS_MAINTAINED = true -- When the plugin is deprecated, this message will be shown to users: -DEPRECATION_MESSAGE = nil +DEPRECATION_MESSAGE = "" UI_TEXT_CONTENT = { HOME = CONTENT_HOME, diff --git a/app/MindWork AI Studio/Plugins/languages/en-us-97dfb1ba-50c4-4440-8dfa-6575daf543c8/plugin.lua b/app/MindWork AI Studio/Plugins/languages/en-us-97dfb1ba-50c4-4440-8dfa-6575daf543c8/plugin.lua index 6e2fea50..5ee75589 100644 --- a/app/MindWork AI Studio/Plugins/languages/en-us-97dfb1ba-50c4-4440-8dfa-6575daf543c8/plugin.lua +++ b/app/MindWork AI Studio/Plugins/languages/en-us-97dfb1ba-50c4-4440-8dfa-6575daf543c8/plugin.lua @@ -34,7 +34,7 @@ TARGET_GROUPS = { "EVERYONE" } IS_MAINTAINED = true -- When the plugin is deprecated, this message will be shown to users: -DEPRECATION_MESSAGE = nil +DEPRECATION_MESSAGE = "" UI_TEXT_CONTENT = { HOME = CONTENT_HOME, diff --git a/app/MindWork AI Studio/Tools/PluginSystem/IPluginMetadata.cs b/app/MindWork AI Studio/Tools/PluginSystem/IPluginMetadata.cs index 28e77b8b..77bc7ea7 100644 --- a/app/MindWork AI Studio/Tools/PluginSystem/IPluginMetadata.cs +++ b/app/MindWork AI Studio/Tools/PluginSystem/IPluginMetadata.cs @@ -60,5 +60,5 @@ public interface IPluginMetadata /// /// The message that should be displayed when the plugin is deprecated. /// - public string? DeprecationMessage { get; } + public string DeprecationMessage { get; } } \ No newline at end of file diff --git a/app/MindWork AI Studio/Tools/PluginSystem/PluginBase.cs b/app/MindWork AI Studio/Tools/PluginSystem/PluginBase.cs index 060e7cce..39ac9aec 100644 --- a/app/MindWork AI Studio/Tools/PluginSystem/PluginBase.cs +++ b/app/MindWork AI Studio/Tools/PluginSystem/PluginBase.cs @@ -48,7 +48,7 @@ public abstract class PluginBase : IPluginMetadata public bool IsMaintained { get; } /// - public string? DeprecationMessage { get; } + public string DeprecationMessage { get; } = string.Empty; /// /// The issues that occurred during the initialization of this plugin. @@ -418,12 +418,12 @@ public abstract class PluginBase : IPluginMetadata /// The error message, when the deprecation message could not be read. /// The read deprecation message. /// True, when the deprecation message could be read successfully. - private bool TryInitDeprecationMessage(out string message, out string? deprecationMessage) + private bool TryInitDeprecationMessage(out string message, out string deprecationMessage) { if (!this.state.Environment["DEPRECATION_MESSAGE"].TryRead(out deprecationMessage)) { - deprecationMessage = null; - message = "The field DEPRECATION_MESSAGE does not exist, is not a valid string. This field is optional: use nil to indicate that the plugin is not deprecated."; + deprecationMessage = string.Empty; + message = "The field DEPRECATION_MESSAGE does not exist, is not a valid string. This message is optional: use an empty string to indicate that the plugin is not deprecated."; return false; } diff --git a/app/MindWork AI Studio/Tools/PluginSystem/PluginMetadata.cs b/app/MindWork AI Studio/Tools/PluginSystem/PluginMetadata.cs index 0e8980bb..06419c21 100644 --- a/app/MindWork AI Studio/Tools/PluginSystem/PluginMetadata.cs +++ b/app/MindWork AI Studio/Tools/PluginSystem/PluginMetadata.cs @@ -38,7 +38,7 @@ public sealed class PluginMetadata(PluginBase plugin) : IPluginMetadata public bool IsMaintained { get; } = plugin.IsMaintained; /// - public string? DeprecationMessage { get; } = plugin.DeprecationMessage; + public string DeprecationMessage { get; } = plugin.DeprecationMessage; #endregion } \ No newline at end of file