2013-07-05 13:47:10 +00:00
|
|
|
|
using System;
|
2013-10-03 15:24:32 +00:00
|
|
|
|
using System.Collections.Generic;
|
|
|
|
|
using System.Runtime.Serialization;
|
2013-07-05 13:47:10 +00:00
|
|
|
|
|
|
|
|
|
namespace MediaBrowser.Controller.Entities
|
|
|
|
|
{
|
|
|
|
|
public class LinkedChild
|
|
|
|
|
{
|
|
|
|
|
public string Path { get; set; }
|
|
|
|
|
public LinkedChildType Type { get; set; }
|
2013-10-03 15:24:32 +00:00
|
|
|
|
|
2014-03-07 15:53:23 +00:00
|
|
|
|
public string ItemName { get; set; }
|
|
|
|
|
public string ItemType { get; set; }
|
|
|
|
|
public int? ItemYear { get; set; }
|
|
|
|
|
|
2013-10-03 15:24:32 +00:00
|
|
|
|
/// <summary>
|
|
|
|
|
/// Serves as a cache
|
|
|
|
|
/// </summary>
|
|
|
|
|
[IgnoreDataMember]
|
2014-02-27 02:44:16 +00:00
|
|
|
|
public Guid? ItemId { get; set; }
|
2013-07-05 13:47:10 +00:00
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
public enum LinkedChildType
|
|
|
|
|
{
|
2014-03-07 18:48:55 +00:00
|
|
|
|
Manual = 0,
|
|
|
|
|
Shortcut = 1
|
2013-07-05 13:47:10 +00:00
|
|
|
|
}
|
|
|
|
|
|
2013-10-03 15:24:32 +00:00
|
|
|
|
public class LinkedChildComparer : IEqualityComparer<LinkedChild>
|
2013-07-05 13:47:10 +00:00
|
|
|
|
{
|
2013-10-03 15:24:32 +00:00
|
|
|
|
public bool Equals(LinkedChild x, LinkedChild y)
|
2013-07-05 13:47:10 +00:00
|
|
|
|
{
|
2013-10-03 15:24:32 +00:00
|
|
|
|
if (x.Type == y.Type)
|
2013-07-05 13:47:10 +00:00
|
|
|
|
{
|
2013-10-03 15:24:32 +00:00
|
|
|
|
return string.Equals(x.Path, y.Path, StringComparison.OrdinalIgnoreCase);
|
2013-07-05 13:47:10 +00:00
|
|
|
|
}
|
2013-10-03 15:24:32 +00:00
|
|
|
|
return false;
|
|
|
|
|
}
|
2013-07-05 13:47:10 +00:00
|
|
|
|
|
2013-10-03 15:24:32 +00:00
|
|
|
|
public int GetHashCode(LinkedChild obj)
|
|
|
|
|
{
|
2014-03-07 18:48:55 +00:00
|
|
|
|
return (obj.Path + obj.Type).GetHashCode();
|
2013-07-05 13:47:10 +00:00
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|