mirror of
https://github.com/jellyfin/jellyfin.git
synced 2026-07-18 20:24:20 +01:00
resolve moviedb issues
This commit is contained in:
@@ -212,12 +212,10 @@ namespace MediaBrowser.Server.Implementations.Channels
|
||||
}
|
||||
|
||||
var itemId = item.Id.ToString("N");
|
||||
var sources = await _manager.GetChannelItemMediaSources(itemId, cancellationToken)
|
||||
var sources = await _manager.GetChannelItemMediaSources(itemId, false, cancellationToken)
|
||||
.ConfigureAwait(false);
|
||||
|
||||
var list = sources.ToList();
|
||||
|
||||
var cachedVersions = list.Where(i => i.Protocol == MediaProtocol.File).ToList();
|
||||
var cachedVersions = sources.Where(i => i.Protocol == MediaProtocol.File).ToList();
|
||||
|
||||
if (cachedVersions.Count > 0)
|
||||
{
|
||||
@@ -225,13 +223,6 @@ namespace MediaBrowser.Server.Implementations.Channels
|
||||
return;
|
||||
}
|
||||
|
||||
var source = list.FirstOrDefault(i => i.Protocol == MediaProtocol.Http);
|
||||
|
||||
if (source == null)
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
var channelItem = (IChannelMediaItem)item;
|
||||
|
||||
var destination = Path.Combine(path, channelItem.ChannelId, itemId);
|
||||
|
||||
@@ -244,7 +244,7 @@ namespace MediaBrowser.Server.Implementations.Channels
|
||||
return item;
|
||||
}
|
||||
|
||||
public async Task<IEnumerable<MediaSourceInfo>> GetChannelItemMediaSources(string id, CancellationToken cancellationToken)
|
||||
public async Task<IEnumerable<MediaSourceInfo>> GetChannelItemMediaSources(string id, bool includeDynamicSources, CancellationToken cancellationToken)
|
||||
{
|
||||
var item = (IChannelMediaItem)_libraryManager.GetItemById(id);
|
||||
|
||||
@@ -255,7 +255,7 @@ namespace MediaBrowser.Server.Implementations.Channels
|
||||
|
||||
IEnumerable<ChannelMediaInfo> results;
|
||||
|
||||
if (requiresCallback != null)
|
||||
if (requiresCallback != null && includeDynamicSources)
|
||||
{
|
||||
results = await GetChannelItemMediaSourcesInternal(requiresCallback, item.ExternalId, cancellationToken)
|
||||
.ConfigureAwait(false);
|
||||
@@ -374,6 +374,18 @@ namespace MediaBrowser.Server.Implementations.Channels
|
||||
Id = id
|
||||
};
|
||||
|
||||
var bitrate = (info.AudioBitrate ?? 0) + (info.VideoBitrate ?? 0);
|
||||
|
||||
if (bitrate > 0)
|
||||
{
|
||||
source.Bitrate = bitrate;
|
||||
}
|
||||
|
||||
if (item is ChannelVideoItem && info.Protocol != MediaProtocol.Rtmp)
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
return source;
|
||||
}
|
||||
|
||||
@@ -1447,7 +1459,7 @@ namespace MediaBrowser.Server.Implementations.Channels
|
||||
IProgress<double> progress, CancellationToken cancellationToken)
|
||||
{
|
||||
var itemId = item.Id.ToString("N");
|
||||
var sources = await GetChannelItemMediaSources(itemId, cancellationToken)
|
||||
var sources = await GetChannelItemMediaSources(itemId, true, cancellationToken)
|
||||
.ConfigureAwait(false);
|
||||
|
||||
var list = sources.Where(i => i.Protocol == MediaProtocol.Http).ToList();
|
||||
|
||||
Reference in New Issue
Block a user