mirror of
https://github.com/jellyfin/jellyfin.git
synced 2024-11-16 10:29:01 -07:00
e3f55a0c54
Co-authored-by: Patrick Barron <18354464+barronpm@users.noreply.github.com>
34 lines
823 B
C#
34 lines
823 B
C#
#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();
|
|
}
|
|
}
|
|
} |