diff options
| author | Cody Robibero <cody@robibe.ro> | 2021-05-11 05:55:46 -0600 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2021-05-11 13:55:46 +0200 |
| commit | e3f55a0c54a2517361c237543aba717fd2a16e69 (patch) | |
| tree | 699391d1880b265db662388c7b5c4823b53623ea /MediaBrowser.Controller/Entities/LinkedChild.cs | |
| parent | a84e8c3884291acb721aeb202139372462e6c800 (diff) | |
Reduce warnings in MediaBrowser.Controller (#6006)
Co-authored-by: Patrick Barron <18354464+barronpm@users.noreply.github.com>
Diffstat (limited to 'MediaBrowser.Controller/Entities/LinkedChild.cs')
| -rw-r--r-- | MediaBrowser.Controller/Entities/LinkedChild.cs | 45 |
1 files changed, 6 insertions, 39 deletions
diff --git a/MediaBrowser.Controller/Entities/LinkedChild.cs b/MediaBrowser.Controller/Entities/LinkedChild.cs index 01c0a9339..fd5fef3dc 100644 --- a/MediaBrowser.Controller/Entities/LinkedChild.cs +++ b/MediaBrowser.Controller/Entities/LinkedChild.cs @@ -3,15 +3,18 @@ #pragma warning disable CS1591 using System; -using System.Collections.Generic; using System.Globalization; using System.Text.Json.Serialization; -using MediaBrowser.Model.IO; namespace MediaBrowser.Controller.Entities { public class LinkedChild { + public LinkedChild() + { + Id = Guid.NewGuid().ToString("N", CultureInfo.InvariantCulture); + } + public string Path { get; set; } public LinkedChildType Type { get; set; } @@ -22,7 +25,7 @@ namespace MediaBrowser.Controller.Entities public string Id { get; set; } /// <summary> - /// Serves as a cache. + /// Gets or sets the linked item id. /// </summary> public Guid? ItemId { get; set; } @@ -41,41 +44,5 @@ namespace MediaBrowser.Controller.Entities return child; } - - public LinkedChild() - { - Id = Guid.NewGuid().ToString("N", CultureInfo.InvariantCulture); - } - } - - public enum LinkedChildType - { - Manual = 0, - Shortcut = 1 - } - - 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(); - } } } |
