diff options
| author | LukePulverenti Luke Pulverenti luke pulverenti <LukePulverenti Luke Pulverenti luke.pulverenti@gmail.com> | 2012-08-24 10:09:28 -0400 |
|---|---|---|
| committer | LukePulverenti Luke Pulverenti luke pulverenti <LukePulverenti Luke Pulverenti luke.pulverenti@gmail.com> | 2012-08-24 10:09:28 -0400 |
| commit | 0a16aeb4483ca8241c781eb40a07942b46bc171c (patch) | |
| tree | 9ec86fdf1325c7c72f5d2bcd775ab36f86c65d8e | |
| parent | 278cf89a887e6ba47643cdb6ecf171a16fed2193 (diff) | |
Override FindItemById in Movie to search special features
| -rw-r--r-- | MediaBrowser.Movies/Entities/Movie.cs | 24 |
1 files changed, 23 insertions, 1 deletions
diff --git a/MediaBrowser.Movies/Entities/Movie.cs b/MediaBrowser.Movies/Entities/Movie.cs index 213615816..29b85f06c 100644 --- a/MediaBrowser.Movies/Entities/Movie.cs +++ b/MediaBrowser.Movies/Entities/Movie.cs @@ -1,4 +1,6 @@ -using System.Collections.Generic;
+using System;
+using System.Collections.Generic;
+using System.Linq;
using MediaBrowser.Model.Entities;
namespace MediaBrowser.Movies.Entities
@@ -6,5 +8,25 @@ namespace MediaBrowser.Movies.Entities public class Movie : Video
{
public IEnumerable<Video> SpecialFeatures { get; set; }
+
+ /// <summary>
+ /// Finds an item by ID, recursively
+ /// </summary>
+ public override BaseItem FindItemById(Guid id)
+ {
+ var item = base.FindItemById(id);
+
+ if (item != null)
+ {
+ return item;
+ }
+
+ if (SpecialFeatures != null)
+ {
+ return SpecialFeatures.FirstOrDefault(i => i.Id == id);
+ }
+
+ return null;
+ }
}
}
|
