Added support for linked children

This commit is contained in:
Luke Pulverenti
2013-07-05 09:47:10 -04:00
parent f98b611deb
commit a19bfc8f07
12 changed files with 194 additions and 44 deletions

View File

@@ -0,0 +1,38 @@
using System;
using System.Collections;
namespace MediaBrowser.Controller.Entities
{
public class LinkedChild
{
public string Path { get; set; }
public LinkedChildType Type { get; set; }
}
public enum LinkedChildType
{
Manual = 1,
Shortcut = 2
}
public class LinkedChildComparer : IComparer
{
public int Compare(object x, object y)
{
var a = (LinkedChild)x;
var b = (LinkedChild)y;
if (!string.Equals(a.Path, b.Path, StringComparison.OrdinalIgnoreCase))
{
return string.Compare(a.Path, b.Path, StringComparison.OrdinalIgnoreCase);
}
if (a.Type != b.Type)
{
return a.Type.CompareTo(b.Type);
}
return 0;
}
}
}