fix roku live tv stream closing

This commit is contained in:
Luke Pulverenti 2015-07-17 22:52:27 -04:00
parent 78a25d2289
commit 1279c6d8b5
3 changed files with 8 additions and 9 deletions

View File

@ -208,13 +208,6 @@
<PostBuildEvent> <PostBuildEvent>
</PostBuildEvent> </PostBuildEvent>
</PropertyGroup> </PropertyGroup>
<Import Project="$(SolutionDir)\.nuget\NuGet.targets" Condition="Exists('$(SolutionDir)\.nuget\NuGet.targets')" />
<Target Name="EnsureNuGetPackageBuildImports" BeforeTargets="PrepareForBuild">
<PropertyGroup>
<ErrorText>This project references NuGet package(s) that are missing on this computer. Enable NuGet Package Restore to download them. For more information, see http://go.microsoft.com/fwlink/?LinkID=322105. The missing file is {0}.</ErrorText>
</PropertyGroup>
<Error Condition="!Exists('$(SolutionDir)\.nuget\NuGet.targets')" Text="$([System.String]::Format('$(ErrorText)', '$(SolutionDir)\.nuget\NuGet.targets'))" />
</Target>
<!-- To modify your build process, add your task inside one of the targets below and uncomment it. <!-- To modify your build process, add your task inside one of the targets below and uncomment it.
Other similar extension points exist, see Microsoft.Common.targets. Other similar extension points exist, see Microsoft.Common.targets.
<Target Name="BeforeBuild"> <Target Name="BeforeBuild">

View File

@ -912,6 +912,9 @@ namespace MediaBrowser.Providers.Manager
{ {
try try
{ {
// Try to throttle this a little bit.
await Task.Delay(100).ConfigureAwait(false);
var artist = item as MusicArtist; var artist = item as MusicArtist;
var task = artist == null var task = artist == null
? RefreshItem(item, refreshItem.Item2, CancellationToken.None) ? RefreshItem(item, refreshItem.Item2, CancellationToken.None)

View File

@ -230,7 +230,7 @@ namespace MediaBrowser.Server.Implementations.Library
private void SetKeyProperties(IMediaSourceProvider provider, MediaSourceInfo mediaSource) private void SetKeyProperties(IMediaSourceProvider provider, MediaSourceInfo mediaSource)
{ {
var prefix = provider.GetType().FullName.GetMD5().ToString("N") + "|"; var prefix = provider.GetType().FullName.GetMD5().ToString("N") + LiveStreamIdDelimeter;
if (!string.IsNullOrWhiteSpace(mediaSource.OpenToken) && !mediaSource.OpenToken.StartsWith(prefix, StringComparison.OrdinalIgnoreCase)) if (!string.IsNullOrWhiteSpace(mediaSource.OpenToken) && !mediaSource.OpenToken.StartsWith(prefix, StringComparison.OrdinalIgnoreCase))
{ {
@ -464,9 +464,12 @@ namespace MediaBrowser.Server.Implementations.Library
} }
} }
// Do not use a pipe here because Roku http requests to the server will fail, without any explicit error message.
private const char LiveStreamIdDelimeter = '_';
private Tuple<IMediaSourceProvider, string> GetProvider(string key) private Tuple<IMediaSourceProvider, string> GetProvider(string key)
{ {
var keys = key.Split(new[] { '|' }, 2); var keys = key.Split(new[] { LiveStreamIdDelimeter }, 2);
var provider = _providers.FirstOrDefault(i => string.Equals(i.GetType().FullName.GetMD5().ToString("N"), keys[0], StringComparison.OrdinalIgnoreCase)); var provider = _providers.FirstOrDefault(i => string.Equals(i.GetType().FullName.GetMD5().ToString("N"), keys[0], StringComparison.OrdinalIgnoreCase));