jellyfin/MediaBrowser.Controller/Entities/LinkedChildComparer.cs
Cody Robibero d461e3912a
Remove warninigs from MediaBrowser.Controller (Part 3) (#6078)
Co-authored-by: Bond-009 <bond.009@outlook.com>
2021-06-06 17:16:41 +02:00

35 lines
861 B
C#

#nullable disable
#pragma warning disable CS1591
using System;
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(StringComparison.Ordinal);
}
}
}