aboutsummaryrefslogtreecommitdiff
path: root/MediaBrowser.Controller/Entities/LinkedChild.cs
diff options
context:
space:
mode:
authorLuke Pulverenti <luke.pulverenti@gmail.com>2013-07-05 09:47:10 -0400
committerLuke Pulverenti <luke.pulverenti@gmail.com>2013-07-05 09:47:10 -0400
commita19bfc8f07790c9108e09606b590b78fbcb512e6 (patch)
tree2545c89e7f9ec59fc854097cea543678c664f20d /MediaBrowser.Controller/Entities/LinkedChild.cs
parentf98b611debd757dcf2b2862fa04f28d514a7fa3d (diff)
Added support for linked children
Diffstat (limited to 'MediaBrowser.Controller/Entities/LinkedChild.cs')
-rw-r--r--MediaBrowser.Controller/Entities/LinkedChild.cs38
1 files changed, 38 insertions, 0 deletions
diff --git a/MediaBrowser.Controller/Entities/LinkedChild.cs b/MediaBrowser.Controller/Entities/LinkedChild.cs
new file mode 100644
index 000000000..edc5a7ac8
--- /dev/null
+++ b/MediaBrowser.Controller/Entities/LinkedChild.cs
@@ -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;
+ }
+ }
+}