aboutsummaryrefslogtreecommitdiff
path: root/MediaBrowser.Common
diff options
context:
space:
mode:
Diffstat (limited to 'MediaBrowser.Common')
-rw-r--r--MediaBrowser.Common/Net/NetworkUtils.cs9
-rw-r--r--MediaBrowser.Common/Plugins/LocalPlugin.cs2
-rw-r--r--MediaBrowser.Common/Plugins/PluginManifest.cs9
3 files changed, 18 insertions, 2 deletions
diff --git a/MediaBrowser.Common/Net/NetworkUtils.cs b/MediaBrowser.Common/Net/NetworkUtils.cs
index 71539b8b78..25a1022d4e 100644
--- a/MediaBrowser.Common/Net/NetworkUtils.cs
+++ b/MediaBrowser.Common/Net/NetworkUtils.cs
@@ -180,9 +180,16 @@ public static partial class NetworkUtils
List<IPData>? tmpResult = null;
for (int a = 0; a < values.Length; a++)
{
+ // Skip entries whose '!' polarity doesn't match this pass
+ var trimmed = values[a].AsSpan().Trim();
+ if (trimmed.StartsWith('!') != negated)
+ {
+ continue;
+ }
+
if (TryParseToSubnet(values[a], out var innerResult, negated))
{
- (tmpResult ??= new()).Add(innerResult);
+ (tmpResult ??= []).Add(innerResult);
}
else
{
diff --git a/MediaBrowser.Common/Plugins/LocalPlugin.cs b/MediaBrowser.Common/Plugins/LocalPlugin.cs
index 96af423cc3..4723be1001 100644
--- a/MediaBrowser.Common/Plugins/LocalPlugin.cs
+++ b/MediaBrowser.Common/Plugins/LocalPlugin.cs
@@ -109,7 +109,7 @@ namespace MediaBrowser.Common.Plugins
{
var inst = Instance?.GetPluginInfo() ?? new PluginInfo(Manifest.Name, Version, Manifest.Description, Manifest.Id, true);
inst.Status = Manifest.Status;
- inst.HasImage = !string.IsNullOrEmpty(Manifest.ImagePath);
+ inst.HasImage = !string.IsNullOrEmpty(Manifest.ImagePath) || !string.IsNullOrEmpty(Manifest.ImageResourceName);
return inst;
}
diff --git a/MediaBrowser.Common/Plugins/PluginManifest.cs b/MediaBrowser.Common/Plugins/PluginManifest.cs
index e0847ccea4..e749e85899 100644
--- a/MediaBrowser.Common/Plugins/PluginManifest.cs
+++ b/MediaBrowser.Common/Plugins/PluginManifest.cs
@@ -108,6 +108,15 @@ namespace MediaBrowser.Common.Plugins
public string? ImagePath { get; set; }
/// <summary>
+ /// Gets or sets the name of an embedded resource in the plugin's assembly
+ /// that should be served as the plugin image.
+ /// Used by bundled/integrated plugins whose images are shipped inside the assembly
+ /// rather than on disk. Ignored when <see cref="ImagePath"/> is set.
+ /// </summary>
+ [JsonIgnore]
+ public string? ImageResourceName { get; set; }
+
+ /// <summary>
/// Gets or sets the collection of assemblies that should be loaded.
/// Paths are considered relative to the plugin folder.
/// </summary>