mirror of
https://github.com/jellyfin/jellyfin.git
synced 2025-07-09 03:04:24 -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 MediaBrowser.Model.Entities;
|
||||||
using System;
|
using System;
|
||||||
using System.Collections;
|
using System.Collections;
|
||||||
@ -271,5 +272,28 @@ namespace MediaBrowser.Controller.Entities
|
|||||||
|
|
||||||
return base.GetDeletePaths();
|
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…
x
Reference in New Issue
Block a user