mirror of
https://github.com/jellyfin/jellyfin.git
synced 2026-07-19 12:44:19 +01:00
Merge pull request #5416 from BaronGreenback/SubnetOverlappFix
This commit is contained in:
@@ -27,9 +27,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);
|
||||
}
|
||||
@@ -190,8 +192,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)
|
||||
{
|
||||
@@ -216,7 +219,7 @@ namespace MediaBrowser.Common.Net
|
||||
|
||||
if (!found)
|
||||
{
|
||||
results.AddItem(outer);
|
||||
results.AddItem(outer, isNetwork);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user