update opening of live streams

This commit is contained in:
Luke Pulverenti
2017-07-02 14:58:56 -04:00
parent 6eec35ecbd
commit 15947c2a4c
10 changed files with 18 additions and 21 deletions

View File

@@ -30,7 +30,7 @@ namespace Emby.Server.Implementations.Channels
return Task.FromResult<IEnumerable<MediaSourceInfo>>(new List<MediaSourceInfo>());
}
public Task<Tuple<MediaSourceInfo, IDirectStreamProvider>> OpenMediaSource(string openToken, CancellationToken cancellationToken)
public Task<Tuple<MediaSourceInfo, IDirectStreamProvider>> OpenMediaSource(string openToken, bool allowLiveStreamProbe, CancellationToken cancellationToken)
{
throw new NotImplementedException();
}

View File

@@ -17,7 +17,7 @@ using MediaBrowser.Model.Tasks;
namespace Emby.Server.Implementations.Data
{
public class CleanDatabaseScheduledTask : IScheduledTask
public class CleanDatabaseScheduledTask : ILibraryPostScanTask
{
private readonly ILibraryManager _libraryManager;
private readonly IItemRepository _itemRepo;
@@ -49,7 +49,7 @@ namespace Emby.Server.Implementations.Data
get { return "Library"; }
}
public async Task Execute(CancellationToken cancellationToken, IProgress<double> progress)
public async Task Run(IProgress<double> progress, CancellationToken cancellationToken)
{
// Ensure these objects are lazy loaded.
// Without this there is a deadlock that will need to be investigated

View File

@@ -371,7 +371,7 @@ namespace Emby.Server.Implementations.Library
var tuple = GetProvider(request.OpenToken);
var provider = tuple.Item1;
var mediaSourceTuple = await provider.OpenMediaSource(tuple.Item2, cancellationToken).ConfigureAwait(false);
var mediaSourceTuple = await provider.OpenMediaSource(tuple.Item2, request.AllowMediaProbe, cancellationToken).ConfigureAwait(false);
var mediaSource = mediaSourceTuple.Item1;

View File

@@ -118,7 +118,7 @@ namespace Emby.Server.Implementations.LiveTv
return list;
}
public async Task<Tuple<MediaSourceInfo, IDirectStreamProvider>> OpenMediaSource(string openToken, CancellationToken cancellationToken)
public async Task<Tuple<MediaSourceInfo, IDirectStreamProvider>> OpenMediaSource(string openToken, bool allowLiveStreamProbe, CancellationToken cancellationToken)
{
MediaSourceInfo stream = null;
const bool isAudio = false;
@@ -140,7 +140,7 @@ namespace Emby.Server.Implementations.LiveTv
try
{
if (!stream.SupportsProbing || stream.MediaStreams.Any(i => i.Index != -1))
if (!allowLiveStreamProbe || !stream.SupportsProbing || stream.MediaStreams.Any(i => i.Index != -1))
{
AddMediaInfo(stream, isAudio, cancellationToken);
}