You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
34 lines
823 B
34 lines
823 B
#nullable disable
|
|
|
|
#pragma warning disable CS1591
|
|
|
|
using System.Collections.Generic;
|
|
using MediaBrowser.Model.IO;
|
|
|
|
namespace MediaBrowser.Controller.Entities
|
|
{
|
|
public class LinkedChildComparer : IEqualityComparer<LinkedChild>
|
|
{
|
|
private readonly IFileSystem _fileSystem;
|
|
|
|
public LinkedChildComparer(IFileSystem fileSystem)
|
|
{
|
|
_fileSystem = fileSystem;
|
|
}
|
|
|
|
public bool Equals(LinkedChild x, LinkedChild y)
|
|
{
|
|
if (x.Type == y.Type)
|
|
{
|
|
return _fileSystem.AreEqual(x.Path, y.Path);
|
|
}
|
|
|
|
return false;
|
|
}
|
|
|
|
public int GetHashCode(LinkedChild obj)
|
|
{
|
|
return ((obj.Path ?? string.Empty) + (obj.LibraryItemId ?? string.Empty) + obj.Type).GetHashCode();
|
|
}
|
|
}
|
|
} |