diff --git a/MediaBrowser.Controller/Entities/Video.cs b/MediaBrowser.Controller/Entities/Video.cs index 425e418ed..a8972a2bb 100644 --- a/MediaBrowser.Controller/Entities/Video.cs +++ b/MediaBrowser.Controller/Entities/Video.cs @@ -1,4 +1,5 @@ -using MediaBrowser.Controller.Resolvers; +using MediaBrowser.Controller.Persistence; +using MediaBrowser.Controller.Resolvers; using MediaBrowser.Model.Entities; using System; using System.Collections; @@ -271,5 +272,28 @@ namespace MediaBrowser.Controller.Entities return base.GetDeletePaths(); } + + public IEnumerable GetMediaStreams() + { + return ItemRepository.GetMediaStreams(new MediaStreamQuery + { + ItemId = Id + }); + } + + public MediaStream GetDefaultVideoStream() + { + if (!DefaultVideoStreamIndex.HasValue) + { + return null; + } + + return ItemRepository.GetMediaStreams(new MediaStreamQuery + { + ItemId = Id, + Index = DefaultVideoStreamIndex.Value + + }).FirstOrDefault(); + } } }