2021-05-11 11:55:46 +00:00
|
|
|
|
#nullable disable
|
|
|
|
|
|
|
|
|
|
#pragma warning disable CS1591
|
|
|
|
|
|
2021-06-06 15:16:41 +00:00
|
|
|
|
using System;
|
2021-05-11 11:55:46 +00:00
|
|
|
|
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)
|
|
|
|
|
{
|
2021-06-06 15:16:41 +00:00
|
|
|
|
return ((obj.Path ?? string.Empty) + (obj.LibraryItemId ?? string.Empty) + obj.Type).GetHashCode(StringComparison.Ordinal);
|
2021-05-11 11:55:46 +00:00
|
|
|
|
}
|
|
|
|
|
}
|
2021-12-24 17:28:27 +00:00
|
|
|
|
}
|