diff --git a/MediaBrowser.Api/Playback/BaseStreamingService.cs b/MediaBrowser.Api/Playback/BaseStreamingService.cs index c716ee150..21c4a3dff 100644 --- a/MediaBrowser.Api/Playback/BaseStreamingService.cs +++ b/MediaBrowser.Api/Playback/BaseStreamingService.cs @@ -1402,6 +1402,13 @@ namespace MediaBrowser.Api.Playback videoRequest.Profile = val; } } + else if (i == 20) + { + if (videoRequest != null) + { + videoRequest.Cabac = string.Equals("true", val, StringComparison.OrdinalIgnoreCase); + } + } } } @@ -1867,6 +1874,14 @@ namespace MediaBrowser.Api.Playback } } + if (request.Cabac.HasValue && request.Cabac.Value) + { + if (videoStream.IsCabac.HasValue && !videoStream.IsCabac.Value) + { + return false; + } + } + return request.EnableAutoStreamCopy; } diff --git a/MediaBrowser.Api/Playback/StreamRequest.cs b/MediaBrowser.Api/Playback/StreamRequest.cs index 8f914b607..dc22fc754 100644 --- a/MediaBrowser.Api/Playback/StreamRequest.cs +++ b/MediaBrowser.Api/Playback/StreamRequest.cs @@ -189,6 +189,9 @@ namespace MediaBrowser.Api.Playback [ApiMember(Name = "EnableAutoStreamCopy", Description = "Whether or not to allow automatic stream copy if requested values match the original source. Defaults to true.", IsRequired = false, DataType = "bool", ParameterType = "query", Verb = "GET")] public bool EnableAutoStreamCopy { get; set; } + [ApiMember(Name = "Cabac", Description = "Enable if cabac encoding is required", IsRequired = false, DataType = "bool", ParameterType = "query", Verb = "GET")] + public bool? Cabac { get; set; } + public VideoStreamRequest() { EnableAutoStreamCopy = true; diff --git a/MediaBrowser.Controller/Entities/Audio/MusicAlbum.cs b/MediaBrowser.Controller/Entities/Audio/MusicAlbum.cs index dc9f83b3c..1f7c62de0 100644 --- a/MediaBrowser.Controller/Entities/Audio/MusicAlbum.cs +++ b/MediaBrowser.Controller/Entities/Audio/MusicAlbum.cs @@ -139,14 +139,14 @@ namespace MediaBrowser.Controller.Entities.Audio { var id = this.GetProviderId(MetadataProviders.MusicBrainzReleaseGroup); - if (!string.IsNullOrEmpty(id)) + if (!string.IsNullOrWhiteSpace(id)) { return "MusicAlbum-MusicBrainzReleaseGroup-" + id; } id = this.GetProviderId(MetadataProviders.MusicBrainzAlbum); - if (!string.IsNullOrEmpty(id)) + if (!string.IsNullOrWhiteSpace(id)) { return "MusicAlbum-Musicbrainz-" + id; } diff --git a/MediaBrowser.Controller/Resolvers/EntityResolutionHelper.cs b/MediaBrowser.Controller/Resolvers/EntityResolutionHelper.cs index 5b4007322..d37301b9e 100644 --- a/MediaBrowser.Controller/Resolvers/EntityResolutionHelper.cs +++ b/MediaBrowser.Controller/Resolvers/EntityResolutionHelper.cs @@ -157,18 +157,24 @@ namespace MediaBrowser.Controller.Resolvers // Normalize // Remove whitespace - filename = filename.Replace("-", string.Empty); - filename = filename.Replace(".", string.Empty); - filename = Regex.Replace(filename, @"\s+", ""); + filename = filename.Replace("-", " "); + filename = filename.Replace(".", " "); + filename = filename.Replace("(", " "); + filename = filename.Replace(")", " "); + filename = Regex.Replace(filename, @"\s+", " "); var prefixes = new[] { "disc", "cd", "disk", "vol", "volume" }; + filename = filename.TrimStart(); + foreach (var prefix in prefixes) { if (filename.IndexOf(prefix, StringComparison.OrdinalIgnoreCase) == 0) { var tmp = filename.Substring(prefix.Length); + tmp = tmp.Trim().Split(' ').FirstOrDefault() ?? string.Empty; + int val; if (int.TryParse(tmp, NumberStyles.Any, CultureInfo.InvariantCulture, out val)) { diff --git a/MediaBrowser.Model/Dlna/StreamBuilder.cs b/MediaBrowser.Model/Dlna/StreamBuilder.cs index 792e6de91..4907abfd7 100644 --- a/MediaBrowser.Model/Dlna/StreamBuilder.cs +++ b/MediaBrowser.Model/Dlna/StreamBuilder.cs @@ -646,9 +646,17 @@ namespace MediaBrowser.Model.Dlna } break; } + case ProfileConditionValue.IsCabac: + { + bool val; + if (BoolHelper.TryParseCultureInvariant(value, out val)) + { + item.Cabac = val; + } + break; + } case ProfileConditionValue.AudioProfile: case ProfileConditionValue.IsAnamorphic: - case ProfileConditionValue.IsCabac: case ProfileConditionValue.Has64BitOffsets: case ProfileConditionValue.PacketLength: case ProfileConditionValue.VideoTimestamp: diff --git a/MediaBrowser.Model/Dlna/StreamInfo.cs b/MediaBrowser.Model/Dlna/StreamInfo.cs index 4c03201f1..e531322f0 100644 --- a/MediaBrowser.Model/Dlna/StreamInfo.cs +++ b/MediaBrowser.Model/Dlna/StreamInfo.cs @@ -30,6 +30,7 @@ namespace MediaBrowser.Model.Dlna public string VideoCodec { get; set; } public string VideoProfile { get; set; } + public bool? Cabac { get; set; } public string AudioCodec { get; set; } public int? AudioStreamIndex { get; set; } @@ -144,6 +145,7 @@ namespace MediaBrowser.Model.Dlna list.Add(item.MaxRefFrames.HasValue ? StringHelper.ToStringCultureInvariant(item.MaxRefFrames.Value) : string.Empty); list.Add(item.MaxVideoBitDepth.HasValue ? StringHelper.ToStringCultureInvariant(item.MaxVideoBitDepth.Value) : string.Empty); list.Add(item.VideoProfile ?? string.Empty); + list.Add(item.Cabac.HasValue ? item.Cabac.Value.ToString() : string.Empty); return string.Format("Params={0}", string.Join(";", list.ToArray())); } diff --git a/MediaBrowser.Server.Implementations/Library/UserManager.cs b/MediaBrowser.Server.Implementations/Library/UserManager.cs index 9e3fd3f17..fa34a2c1f 100644 --- a/MediaBrowser.Server.Implementations/Library/UserManager.cs +++ b/MediaBrowser.Server.Implementations/Library/UserManager.cs @@ -1,5 +1,4 @@ -using MediaBrowser.Common; -using MediaBrowser.Common.Events; +using MediaBrowser.Common.Events; using MediaBrowser.Common.Extensions; using MediaBrowser.Common.Net; using MediaBrowser.Controller; diff --git a/MediaBrowser.Server.Mono/MediaBrowser.Server.Mono.csproj b/MediaBrowser.Server.Mono/MediaBrowser.Server.Mono.csproj index 6aed66744..825ad2043 100644 --- a/MediaBrowser.Server.Mono/MediaBrowser.Server.Mono.csproj +++ b/MediaBrowser.Server.Mono/MediaBrowser.Server.Mono.csproj @@ -150,14 +150,6 @@ MediaInfo\osx\libmediainfo.dylib PreserveNewest - - sqlite3\linux\lib\libsqlite3.so.0.8.6 - PreserveNewest - - - sqlite3\linux\lib64\libsqlite3.so.0.8.6 - PreserveNewest - libsqlite3.0.dylib PreserveNewest diff --git a/MediaBrowser.Server.Mono/System.Data.SQLite.dll.config b/MediaBrowser.Server.Mono/System.Data.SQLite.dll.config index 19b764482..83a6cd9f3 100644 --- a/MediaBrowser.Server.Mono/System.Data.SQLite.dll.config +++ b/MediaBrowser.Server.Mono/System.Data.SQLite.dll.config @@ -1,5 +1,3 @@ - - - + \ No newline at end of file diff --git a/MediaBrowser.Server.Startup.Common/FFMpeg/FFMpegDownloadInfo.cs b/MediaBrowser.Server.Startup.Common/FFMpeg/FFMpegDownloadInfo.cs index 1777e1bd2..e4a9e8434 100644 --- a/MediaBrowser.Server.Startup.Common/FFMpeg/FFMpegDownloadInfo.cs +++ b/MediaBrowser.Server.Startup.Common/FFMpeg/FFMpegDownloadInfo.cs @@ -63,7 +63,7 @@ namespace MediaBrowser.Server.Startup.Common.FFMpeg info.FFMpegFilename = "ffmpeg.exe"; info.FFProbeFilename = "ffprobe.exe"; - info.Version = "20141005"; + info.Version = "20141111"; info.ArchiveType = "7z"; switch (environment.SystemArchitecture) @@ -92,14 +92,14 @@ namespace MediaBrowser.Server.Startup.Common.FFMpeg case Architecture.X86_X64: return new[] { - "http://ffmpeg.zeranoe.com/builds/win64/static/ffmpeg-20141005-git-e079d43-win64-static.7z", - "https://github.com/MediaBrowser/MediaBrowser.Resources/raw/master/ffmpeg/windows/ffmpeg-20141005-git-e079d43-win64-static.7z" + "http://ffmpeg.zeranoe.com/builds/win64/static/ffmpeg-20141111-git-48efe9e-win64-static.7z", + "https://github.com/MediaBrowser/MediaBrowser.Resources/raw/master/ffmpeg/windows/ffmpeg-20141111-git-48efe9e-win64-static.7z" }; case Architecture.X86: return new[] { - "http://ffmpeg.zeranoe.com/builds/win32/static/ffmpeg-20141005-git-e079d43-win32-static.7z", - "https://github.com/MediaBrowser/MediaBrowser.Resources/raw/master/ffmpeg/windows/ffmpeg-20141005-git-e079d43-win32-static.7z" + "http://ffmpeg.zeranoe.com/builds/win32/static/ffmpeg-20141111-git-48efe9e-win32-static.7z", + "https://github.com/MediaBrowser/MediaBrowser.Resources/raw/master/ffmpeg/windows/ffmpeg-20141111-git-48efe9e-win32-static.7z" }; } break; diff --git a/MediaBrowser.Tests/Resolvers/MusicResolverTests.cs b/MediaBrowser.Tests/Resolvers/MusicResolverTests.cs index 201f25263..fa63366ad 100644 --- a/MediaBrowser.Tests/Resolvers/MusicResolverTests.cs +++ b/MediaBrowser.Tests/Resolvers/MusicResolverTests.cs @@ -25,6 +25,12 @@ namespace MediaBrowser.Tests.Resolvers Assert.IsTrue(EntityResolutionHelper.IsMultiDiscAlbumFolder(@"cd - 1")); Assert.IsTrue(EntityResolutionHelper.IsMultiDiscAlbumFolder(@"disc- 1")); Assert.IsTrue(EntityResolutionHelper.IsMultiDiscAlbumFolder(@"disk - 1")); + + Assert.IsTrue(EntityResolutionHelper.IsMultiDiscAlbumFolder(@"Disc 01 (Hugo Wolf · 24 Lieder)")); + Assert.IsTrue(EntityResolutionHelper.IsMultiDiscAlbumFolder(@"Disc 04 (Encores and Folk Songs)")); + Assert.IsTrue(EntityResolutionHelper.IsMultiDiscAlbumFolder(@"Disc04 (Encores and Folk Songs)")); + Assert.IsTrue(EntityResolutionHelper.IsMultiDiscAlbumFolder(@"Disc 04(Encores and Folk Songs)")); + Assert.IsTrue(EntityResolutionHelper.IsMultiDiscAlbumFolder(@"Disc04(Encores and Folk Songs)")); } } }