mirror of
https://github.com/jellyfin/jellyfin.git
synced 2026-03-20 09:06:38 +00:00
Merge pull request #5416 from BaronGreenback/SubnetOverlappFix
(cherry picked from commit 19e7ebb279)
Signed-off-by: Joshua M. Boniface <joshua@boniface.me>
This commit is contained in:
@@ -32,9 +32,11 @@ namespace MediaBrowser.Common.Net
|
||||
/// </summary>
|
||||
/// <param name="source">The <see cref="Collection{IPObject}"/>.</param>
|
||||
/// <param name="item">Item to add.</param>
|
||||
public static void AddItem(this Collection<IPObject> source, IPObject item)
|
||||
/// <param name="itemsAreNetworks">If <c>true</c> the values are treated as subnets.
|
||||
/// If <b>false</b> items are addresses.</param>
|
||||
public static void AddItem(this Collection<IPObject> source, IPObject item, bool itemsAreNetworks = true)
|
||||
{
|
||||
if (!source.ContainsAddress(item))
|
||||
if (!source.ContainsAddress(item) || !itemsAreNetworks)
|
||||
{
|
||||
source.Add(item);
|
||||
}
|
||||
@@ -195,8 +197,9 @@ namespace MediaBrowser.Common.Net
|
||||
/// </summary>
|
||||
/// <param name="source">The <see cref="Collection{IPObject}"/>.</param>
|
||||
/// <param name="excludeList">Items to exclude.</param>
|
||||
/// <param name="isNetwork">Collection is a network collection.</param>
|
||||
/// <returns>A new collection, with the items excluded.</returns>
|
||||
public static Collection<IPObject> Exclude(this Collection<IPObject> source, Collection<IPObject> excludeList)
|
||||
public static Collection<IPObject> Exclude(this Collection<IPObject> source, Collection<IPObject> excludeList, bool isNetwork)
|
||||
{
|
||||
if (source.Count == 0 || excludeList == null)
|
||||
{
|
||||
@@ -221,7 +224,7 @@ namespace MediaBrowser.Common.Net
|
||||
|
||||
if (!found)
|
||||
{
|
||||
results.AddItem(outer);
|
||||
results.AddItem(outer, isNetwork);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user