From 1c1336ac084848d43f57e2b57a0568f78c278a2d Mon Sep 17 00:00:00 2001 From: Luke Pulverenti Date: Sun, 14 Dec 2014 15:01:26 -0500 Subject: [PATCH] beta fixes --- .../Playback/Hls/DynamicHlsService.cs | 10 ++++++++ MediaBrowser.Api/Session/SessionsService.cs | 23 ++++++++++++++++++- MediaBrowser.Model/Dlna/StreamBuilder.cs | 17 ++++++++++++-- .../Session/ClientCapabilities.cs | 5 +++- .../Library/CoreResolutionIgnoreRule.cs | 9 ++++++++ ...MediaBrowser.Server.Implementations.csproj | 2 +- .../packages.config | 2 +- Nuget/MediaBrowser.Common.Internal.nuspec | 4 ++-- Nuget/MediaBrowser.Common.nuspec | 2 +- Nuget/MediaBrowser.Model.Signed.nuspec | 2 +- Nuget/MediaBrowser.Server.Core.nuspec | 4 ++-- SharedVersion.cs | 4 ++-- 12 files changed, 70 insertions(+), 14 deletions(-) diff --git a/MediaBrowser.Api/Playback/Hls/DynamicHlsService.cs b/MediaBrowser.Api/Playback/Hls/DynamicHlsService.cs index af41ecb36..fe3bd12fb 100644 --- a/MediaBrowser.Api/Playback/Hls/DynamicHlsService.cs +++ b/MediaBrowser.Api/Playback/Hls/DynamicHlsService.cs @@ -501,6 +501,16 @@ namespace MediaBrowser.Api.Playback.Hls return false; } + if (string.Equals(state.OutputVideoCodec, "copy", StringComparison.OrdinalIgnoreCase)) + { + return false; + } + + if (string.Equals(state.OutputAudioCodec, "copy", StringComparison.OrdinalIgnoreCase)) + { + return false; + } + return state.VideoRequest.VideoBitRate.HasValue; } diff --git a/MediaBrowser.Api/Session/SessionsService.cs b/MediaBrowser.Api/Session/SessionsService.cs index df50255ab..d2881893b 100644 --- a/MediaBrowser.Api/Session/SessionsService.cs +++ b/MediaBrowser.Api/Session/SessionsService.cs @@ -241,11 +241,23 @@ namespace MediaBrowser.Api.Session [ApiMember(Name = "SupportsSync", Description = "Determines whether sync is supported.", IsRequired = false, DataType = "bool", ParameterType = "query", Verb = "POST")] public bool SupportsSync { get; set; } - + [ApiMember(Name = "SupportsUniqueIdentifier", Description = "Determines whether the device supports a unique identifier.", IsRequired = false, DataType = "bool", ParameterType = "query", Verb = "POST")] public bool SupportsUniqueIdentifier { get; set; } } + [Route("/Sessions/Capabilities/Full", "POST", Summary = "Updates capabilities for a device")] + [Authenticated] + public class PostFullCapabilities : ClientCapabilities, IReturnVoid + { + /// + /// Gets or sets the id. + /// + /// The id. + [ApiMember(Name = "Id", Description = "Session Id", IsRequired = true, DataType = "string", ParameterType = "path", Verb = "POST")] + public string Id { get; set; } + } + [Route("/Sessions/Logout", "POST", Summary = "Reports that a session has ended")] [Authenticated] public class ReportSessionEnded : IReturnVoid @@ -529,5 +541,14 @@ namespace MediaBrowser.Api.Session SupportsUniqueIdentifier = request.SupportsUniqueIdentifier }); } + + public void Post(PostFullCapabilities request) + { + if (string.IsNullOrWhiteSpace(request.Id)) + { + request.Id = GetSession().Id; + } + _sessionManager.ReportCapabilities(request.Id, request); + } } } \ No newline at end of file diff --git a/MediaBrowser.Model/Dlna/StreamBuilder.cs b/MediaBrowser.Model/Dlna/StreamBuilder.cs index fb26f1ff8..208ea1420 100644 --- a/MediaBrowser.Model/Dlna/StreamBuilder.cs +++ b/MediaBrowser.Model/Dlna/StreamBuilder.cs @@ -625,6 +625,12 @@ namespace MediaBrowser.Model.Dlna continue; } + // No way to express this + if (condition.Condition == ProfileConditionType.GreaterThanEqual) + { + continue; + } + switch (condition.Property) { case ProfileConditionValue.AudioBitrate: @@ -650,12 +656,19 @@ namespace MediaBrowser.Model.Dlna bool val; if (BoolHelper.TryParseCultureInvariant(value, out val)) { - item.Cabac = val; + if (condition.Condition == ProfileConditionType.Equals) + { + item.Cabac = val; + } + else if (condition.Condition == ProfileConditionType.NotEquals) + { + item.Cabac = !val; + } } break; } - case ProfileConditionValue.AudioProfile: case ProfileConditionValue.IsAnamorphic: + case ProfileConditionValue.AudioProfile: case ProfileConditionValue.Has64BitOffsets: case ProfileConditionValue.PacketLength: case ProfileConditionValue.VideoTimestamp: diff --git a/MediaBrowser.Model/Session/ClientCapabilities.cs b/MediaBrowser.Model/Session/ClientCapabilities.cs index f2faa0545..5a806a867 100644 --- a/MediaBrowser.Model/Session/ClientCapabilities.cs +++ b/MediaBrowser.Model/Session/ClientCapabilities.cs @@ -1,4 +1,5 @@ -using System.Collections.Generic; +using MediaBrowser.Model.Dlna; +using System.Collections.Generic; namespace MediaBrowser.Model.Session { @@ -16,6 +17,8 @@ namespace MediaBrowser.Model.Session public bool SupportsUniqueIdentifier { get; set; } public bool SupportsSync { get; set; } + public DeviceProfile DeviceProfile { get; set; } + public ClientCapabilities() { PlayableMediaTypes = new List(); diff --git a/MediaBrowser.Server.Implementations/Library/CoreResolutionIgnoreRule.cs b/MediaBrowser.Server.Implementations/Library/CoreResolutionIgnoreRule.cs index 7edd9541f..1628ccc32 100644 --- a/MediaBrowser.Server.Implementations/Library/CoreResolutionIgnoreRule.cs +++ b/MediaBrowser.Server.Implementations/Library/CoreResolutionIgnoreRule.cs @@ -104,6 +104,15 @@ namespace MediaBrowser.Server.Implementations.Library } else { + if (args.Parent != null) + { + // Don't resolve these into audio files + if (string.Equals(_fileSystem.GetFileNameWithoutExtension(filename), BaseItem.ThemeSongFilename) && _libraryManager.IsAudioFile(filename)) + { + return true; + } + } + // Ignore samples if (filename.IndexOf(".sample.", StringComparison.OrdinalIgnoreCase) != -1) { diff --git a/MediaBrowser.Server.Implementations/MediaBrowser.Server.Implementations.csproj b/MediaBrowser.Server.Implementations/MediaBrowser.Server.Implementations.csproj index 514b7b1f1..84d62df3a 100644 --- a/MediaBrowser.Server.Implementations/MediaBrowser.Server.Implementations.csproj +++ b/MediaBrowser.Server.Implementations/MediaBrowser.Server.Implementations.csproj @@ -51,7 +51,7 @@ False - ..\packages\MediaBrowser.Naming.1.0.0.16\lib\portable-net45+sl4+wp71+win8+wpa81\MediaBrowser.Naming.dll + ..\packages\MediaBrowser.Naming.1.0.0.17\lib\portable-net45+sl4+wp71+win8+wpa81\MediaBrowser.Naming.dll False diff --git a/MediaBrowser.Server.Implementations/packages.config b/MediaBrowser.Server.Implementations/packages.config index 017452650..062e34201 100644 --- a/MediaBrowser.Server.Implementations/packages.config +++ b/MediaBrowser.Server.Implementations/packages.config @@ -1,6 +1,6 @@  - + \ No newline at end of file diff --git a/Nuget/MediaBrowser.Common.Internal.nuspec b/Nuget/MediaBrowser.Common.Internal.nuspec index c7cfeb9b8..69e21ea16 100644 --- a/Nuget/MediaBrowser.Common.Internal.nuspec +++ b/Nuget/MediaBrowser.Common.Internal.nuspec @@ -2,7 +2,7 @@ MediaBrowser.Common.Internal - 3.0.517 + 3.0.518 MediaBrowser.Common.Internal Luke ebr,Luke,scottisafool @@ -12,7 +12,7 @@ Contains common components shared by Media Browser Theater and Media Browser Server. Not intended for plugin developer consumption. Copyright © Media Browser 2013 - + diff --git a/Nuget/MediaBrowser.Common.nuspec b/Nuget/MediaBrowser.Common.nuspec index 16aa7b024..a251eee79 100644 --- a/Nuget/MediaBrowser.Common.nuspec +++ b/Nuget/MediaBrowser.Common.nuspec @@ -2,7 +2,7 @@ MediaBrowser.Common - 3.0.517 + 3.0.518 MediaBrowser.Common Media Browser Team ebr,Luke,scottisafool diff --git a/Nuget/MediaBrowser.Model.Signed.nuspec b/Nuget/MediaBrowser.Model.Signed.nuspec index aa1acad97..a913bb89d 100644 --- a/Nuget/MediaBrowser.Model.Signed.nuspec +++ b/Nuget/MediaBrowser.Model.Signed.nuspec @@ -2,7 +2,7 @@ MediaBrowser.Model.Signed - 3.0.517 + 3.0.518 MediaBrowser.Model - Signed Edition Media Browser Team ebr,Luke,scottisafool diff --git a/Nuget/MediaBrowser.Server.Core.nuspec b/Nuget/MediaBrowser.Server.Core.nuspec index 70c9ce9f3..d1d34e852 100644 --- a/Nuget/MediaBrowser.Server.Core.nuspec +++ b/Nuget/MediaBrowser.Server.Core.nuspec @@ -2,7 +2,7 @@ MediaBrowser.Server.Core - 3.0.517 + 3.0.518 Media Browser.Server.Core Media Browser Team ebr,Luke,scottisafool @@ -12,7 +12,7 @@ Contains core components required to build plugins for Media Browser Server. Copyright © Media Browser 2013 - + diff --git a/SharedVersion.cs b/SharedVersion.cs index b3958af16..9b152093c 100644 --- a/SharedVersion.cs +++ b/SharedVersion.cs @@ -1,4 +1,4 @@ using System.Reflection; -//[assembly: AssemblyVersion("3.0.*")] -[assembly: AssemblyVersion("3.0.5462.0")] +[assembly: AssemblyVersion("3.0.*")] +//[assembly: AssemblyVersion("3.0.5462.0")]