Merge pull request #3005 from MediaBrowser/dev

Dev
pull/1154/head
Luke 7 years ago committed by GitHub
commit 0f4420133c

@ -373,8 +373,6 @@ namespace Emby.Server.Implementations.Dto
} }
NormalizeMediaSourceContainers(dto); NormalizeMediaSourceContainers(dto);
dto.SupportsMediaSourceSelection = hasMediaSources.SupportsMediaSourceSelection();
} }
} }

@ -57,7 +57,8 @@ namespace Emby.Server.Implementations.LiveTv.TunerHosts.HdHomerun
Logger.Info("Opened HDHR stream from {0}", url); Logger.Info("Opened HDHR stream from {0}", url);
StartStreaming(response, LiveStreamCancellationTokenSource.Token); var taskCompletionSource = new TaskCompletionSource<bool>();
StartStreaming(response, taskCompletionSource, LiveStreamCancellationTokenSource.Token);
//OpenedMediaSource.Protocol = MediaProtocol.File; //OpenedMediaSource.Protocol = MediaProtocol.File;
//OpenedMediaSource.Path = tempFile; //OpenedMediaSource.Path = tempFile;
@ -71,6 +72,7 @@ namespace Emby.Server.Implementations.LiveTv.TunerHosts.HdHomerun
//OpenedMediaSource.SupportsDirectPlay = false; //OpenedMediaSource.SupportsDirectPlay = false;
//OpenedMediaSource.SupportsDirectStream = true; //OpenedMediaSource.SupportsDirectStream = true;
//OpenedMediaSource.SupportsTranscoding = true; //OpenedMediaSource.SupportsTranscoding = true;
await taskCompletionSource.Task.ConfigureAwait(false);
} }
protected override void CloseInternal() protected override void CloseInternal()
@ -78,7 +80,7 @@ namespace Emby.Server.Implementations.LiveTv.TunerHosts.HdHomerun
LiveStreamCancellationTokenSource.Cancel(); LiveStreamCancellationTokenSource.Cancel();
} }
private Task StartStreaming(HttpResponseInfo response, CancellationToken cancellationToken) private Task StartStreaming(HttpResponseInfo response, TaskCompletionSource<bool> openTaskCompletionSource, CancellationToken cancellationToken)
{ {
return Task.Run(async () => return Task.Run(async () =>
{ {
@ -90,10 +92,9 @@ namespace Emby.Server.Implementations.LiveTv.TunerHosts.HdHomerun
{ {
Logger.Info("Beginning HdHomerunHttpStream stream to file"); Logger.Info("Beginning HdHomerunHttpStream stream to file");
FileSystem.CreateDirectory(FileSystem.GetDirectoryName(TempFilePath));
using (var fileStream = FileSystem.GetFileStream(TempFilePath, FileOpenMode.Create, FileAccessMode.Write, FileShareMode.Read, FileOpenOptions.None)) using (var fileStream = FileSystem.GetFileStream(TempFilePath, FileOpenMode.Create, FileAccessMode.Write, FileShareMode.Read, FileOpenOptions.None))
{ {
StreamHelper.CopyTo(stream, fileStream, 81920, null, cancellationToken); StreamHelper.CopyTo(stream, fileStream, 81920, () => Resolve(openTaskCompletionSource), cancellationToken);
} }
} }
} }
@ -111,11 +112,8 @@ namespace Emby.Server.Implementations.LiveTv.TunerHosts.HdHomerun
} }
private void Resolve(TaskCompletionSource<bool> openTaskCompletionSource) private void Resolve(TaskCompletionSource<bool> openTaskCompletionSource)
{
Task.Run(() =>
{ {
openTaskCompletionSource.TrySetResult(true); openTaskCompletionSource.TrySetResult(true);
});
} }
} }
} }

@ -51,11 +51,6 @@ namespace MediaBrowser.Controller.Entities.Audio
return 1; return 1;
} }
public bool SupportsMediaSourceSelection()
{
return false;
}
[IgnoreDataMember] [IgnoreDataMember]
public override bool SupportsPlayedStatus public override bool SupportsPlayedStatus
{ {

@ -13,6 +13,5 @@ namespace MediaBrowser.Controller.Entities
/// <returns>Task{IEnumerable{MediaSourceInfo}}.</returns> /// <returns>Task{IEnumerable{MediaSourceInfo}}.</returns>
List<MediaSourceInfo> GetMediaSources(bool enablePathSubstitution); List<MediaSourceInfo> GetMediaSources(bool enablePathSubstitution);
List<MediaStream> GetMediaStreams(); List<MediaStream> GetMediaStreams();
bool SupportsMediaSourceSelection();
} }
} }

@ -109,11 +109,6 @@ namespace MediaBrowser.Controller.Entities
get { return true; } get { return true; }
} }
public bool SupportsMediaSourceSelection()
{
return SourceType == SourceType.Library;
}
/// <summary> /// <summary>
/// Gets or sets the timestamp. /// Gets or sets the timestamp.
/// </summary> /// </summary>

@ -24,11 +24,6 @@ namespace MediaBrowser.Controller.LiveTv
return list; return list;
} }
public bool SupportsMediaSourceSelection()
{
return false;
}
public override UnratedItem GetBlockUnratedType() public override UnratedItem GetBlockUnratedType()
{ {
return UnratedItem.LiveTvChannel; return UnratedItem.LiveTvChannel;

@ -75,7 +75,6 @@ namespace MediaBrowser.Model.Dto
public bool? CanDownload { get; set; } public bool? CanDownload { get; set; }
public bool? HasSubtitles { get; set; } public bool? HasSubtitles { get; set; }
public bool? SupportsMediaSourceSelection { get; set; }
public string PreferredMetadataLanguage { get; set; } public string PreferredMetadataLanguage { get; set; }
public string PreferredMetadataCountryCode { get; set; } public string PreferredMetadataCountryCode { get; set; }

@ -1,3 +1,3 @@
using System.Reflection; using System.Reflection;
[assembly: AssemblyVersion("3.2.36.2")] [assembly: AssemblyVersion("3.2.36.3")]

Loading…
Cancel
Save