mirror of
https://github.com/jellyfin/jellyfin.git
synced 2026-04-22 01:54:42 +01:00
added SupportsExternalStream to MediaStream
This commit is contained in:
@@ -0,0 +1,51 @@
|
||||
using MediaBrowser.Controller.Library;
|
||||
using MediaBrowser.Controller.Persistence;
|
||||
using MediaBrowser.Model.Entities;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
|
||||
namespace MediaBrowser.Server.Implementations.Library
|
||||
{
|
||||
public class MediaSourceManager : IMediaSourceManager
|
||||
{
|
||||
private readonly IItemRepository _itemRepo;
|
||||
|
||||
public MediaSourceManager(IItemRepository itemRepo)
|
||||
{
|
||||
_itemRepo = itemRepo;
|
||||
}
|
||||
|
||||
public IEnumerable<MediaStream> GetMediaStreams(MediaStreamQuery query)
|
||||
{
|
||||
var list = _itemRepo.GetMediaStreams(query)
|
||||
.ToList();
|
||||
|
||||
foreach (var stream in list)
|
||||
{
|
||||
stream.SupportsExternalStream = StreamSupportsExternalStream(stream);
|
||||
}
|
||||
|
||||
return list;
|
||||
}
|
||||
|
||||
private bool StreamSupportsExternalStream(MediaStream stream)
|
||||
{
|
||||
if (stream.IsExternal)
|
||||
{
|
||||
return true;
|
||||
}
|
||||
|
||||
if (stream.IsTextSubtitleStream)
|
||||
{
|
||||
return InternalTextStreamSupportsExternalStream(stream);
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
private bool InternalTextStreamSupportsExternalStream(MediaStream stream)
|
||||
{
|
||||
return true;
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user