mirror of
https://github.com/jellyfin/jellyfin.git
synced 2024-09-06 05:47:14 -04:00
added convenience methods on Video to get MediaStreams
This commit is contained in:
parent
672f71d889
commit
841cf92923
@ -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<MediaStream> 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();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user