From 997b3577505f60dc6ae5b78205340c336fa48ef4 Mon Sep 17 00:00:00 2001 From: Luke Pulverenti Date: Thu, 20 Apr 2017 23:51:49 -0400 Subject: [PATCH 01/43] 3.2.13.1 --- SharedVersion.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/SharedVersion.cs b/SharedVersion.cs index ab54dc7807..25883d0be6 100644 --- a/SharedVersion.cs +++ b/SharedVersion.cs @@ -1,3 +1,3 @@ using System.Reflection; -[assembly: AssemblyVersion("3.2.12.11")] +[assembly: AssemblyVersion("3.2.13.1")] From 875588676123d9976ba8824ced006fcebbcad284 Mon Sep 17 00:00:00 2001 From: Luke Pulverenti Date: Fri, 21 Apr 2017 16:03:07 -0400 Subject: [PATCH 02/43] switch to hwaccel auto --- .../LiveTv/EmbyTV/EmbyTV.cs | 2 +- .../LiveTv/EmbyTV/EncodedRecorder.cs | 19 +++++++++++++-- MediaBrowser.Api/BaseApiService.cs | 4 ++-- MediaBrowser.Api/Images/ImageService.cs | 4 ++-- MediaBrowser.Api/TvShowsService.cs | 2 +- MediaBrowser.Api/UserService.cs | 8 +++---- .../MediaEncoding/EncodingHelper.cs | 5 ++++ .../Encoder/MediaEncoder.cs | 24 +------------------ .../Subtitles/SubtitleEncoder.cs | 3 +-- 9 files changed, 34 insertions(+), 37 deletions(-) diff --git a/Emby.Server.Implementations/LiveTv/EmbyTV/EmbyTV.cs b/Emby.Server.Implementations/LiveTv/EmbyTV/EmbyTV.cs index 666c1fdcd4..5082f1b044 100644 --- a/Emby.Server.Implementations/LiveTv/EmbyTV/EmbyTV.cs +++ b/Emby.Server.Implementations/LiveTv/EmbyTV/EmbyTV.cs @@ -1765,7 +1765,7 @@ namespace Emby.Server.Implementations.LiveTv.EmbyTV if (regInfo.IsValid) { - return new EncodedRecorder(_logger, _fileSystem, _mediaEncoder, _config.ApplicationPaths, _jsonSerializer, config, _httpClient, _processFactory); + return new EncodedRecorder(_logger, _fileSystem, _mediaEncoder, _config.ApplicationPaths, _jsonSerializer, config, _httpClient, _processFactory, _config); } } diff --git a/Emby.Server.Implementations/LiveTv/EmbyTV/EncodedRecorder.cs b/Emby.Server.Implementations/LiveTv/EmbyTV/EncodedRecorder.cs index 6cc5b69208..8ee3d71b5e 100644 --- a/Emby.Server.Implementations/LiveTv/EmbyTV/EncodedRecorder.cs +++ b/Emby.Server.Implementations/LiveTv/EmbyTV/EncodedRecorder.cs @@ -11,14 +11,16 @@ using MediaBrowser.Model.IO; using MediaBrowser.Common.IO; using MediaBrowser.Common.Net; using MediaBrowser.Controller; -using MediaBrowser.Controller.IO; +using MediaBrowser.Controller.Configuration; using MediaBrowser.Controller.MediaEncoding; +using MediaBrowser.Model.Configuration; using MediaBrowser.Model.Diagnostics; using MediaBrowser.Model.Dto; using MediaBrowser.Model.Entities; using MediaBrowser.Model.LiveTv; using MediaBrowser.Model.Logging; using MediaBrowser.Model.Serialization; +using MediaBrowser.Common.Configuration; namespace Emby.Server.Implementations.LiveTv.EmbyTV { @@ -37,8 +39,9 @@ namespace Emby.Server.Implementations.LiveTv.EmbyTV private readonly IProcessFactory _processFactory; private readonly IJsonSerializer _json; private readonly TaskCompletionSource _taskCompletionSource = new TaskCompletionSource(); + private readonly IServerConfigurationManager _config; - public EncodedRecorder(ILogger logger, IFileSystem fileSystem, IMediaEncoder mediaEncoder, IServerApplicationPaths appPaths, IJsonSerializer json, LiveTvOptions liveTvOptions, IHttpClient httpClient, IProcessFactory processFactory) + public EncodedRecorder(ILogger logger, IFileSystem fileSystem, IMediaEncoder mediaEncoder, IServerApplicationPaths appPaths, IJsonSerializer json, LiveTvOptions liveTvOptions, IHttpClient httpClient, IProcessFactory processFactory, IServerConfigurationManager config) { _logger = logger; _fileSystem = fileSystem; @@ -48,6 +51,7 @@ namespace Emby.Server.Implementations.LiveTv.EmbyTV _liveTvOptions = liveTvOptions; _httpClient = httpClient; _processFactory = processFactory; + _config = config; } private string OutputFormat @@ -89,6 +93,11 @@ namespace Emby.Server.Implementations.LiveTv.EmbyTV _logger.Info("Recording completed to file {0}", targetFile); } + private EncodingOptions GetEncodingOptions() + { + return _config.GetConfiguration("encoding"); + } + private Task RecordFromFile(MediaSourceInfo mediaSource, string inputFile, string targetFile, TimeSpan duration, Action onStarted, CancellationToken cancellationToken) { _targetPath = targetFile; @@ -163,6 +172,12 @@ namespace Emby.Server.Implementations.LiveTv.EmbyTV var durationParam = " -t " + _mediaEncoder.GetTimeParameter(duration.Ticks); var inputModifiers = "-fflags +genpts -async 1 -vsync -1"; + + if (!string.IsNullOrWhiteSpace(GetEncodingOptions().HardwareAccelerationType)) + { + inputModifiers += " -hwaccel auto"; + } + var commandLineArgs = "-i \"{0}\"{5} {2} -map_metadata -1 -threads 0 {3}{4}{6} -y \"{1}\""; long startTimeTicks = 0; diff --git a/MediaBrowser.Api/BaseApiService.cs b/MediaBrowser.Api/BaseApiService.cs index 1f21a1dd15..a802e56af0 100644 --- a/MediaBrowser.Api/BaseApiService.cs +++ b/MediaBrowser.Api/BaseApiService.cs @@ -66,7 +66,7 @@ namespace MediaBrowser.Api return ResultFactory.GetOptimizedResult(Request, result); } - protected void AssertCanUpdateUser(IAuthorizationContext authContext, IUserManager userManager, string userId) + protected void AssertCanUpdateUser(IAuthorizationContext authContext, IUserManager userManager, string userId, bool restrictUserPreferences) { var auth = authContext.GetAuthorizationInfo(Request); @@ -80,7 +80,7 @@ namespace MediaBrowser.Api throw new SecurityException("Unauthorized access."); } } - else + else if (restrictUserPreferences) { if (!authenticatedUser.Policy.EnableUserPreferenceAccess) { diff --git a/MediaBrowser.Api/Images/ImageService.cs b/MediaBrowser.Api/Images/ImageService.cs index 392654aa25..9f144c8e45 100644 --- a/MediaBrowser.Api/Images/ImageService.cs +++ b/MediaBrowser.Api/Images/ImageService.cs @@ -427,7 +427,7 @@ namespace MediaBrowser.Api.Images public void Post(PostUserImage request) { var userId = GetPathValue(1); - AssertCanUpdateUser(_authContext, _userManager, userId); + AssertCanUpdateUser(_authContext, _userManager, userId, true); request.Type = (ImageType)Enum.Parse(typeof(ImageType), GetPathValue(3), true); @@ -462,7 +462,7 @@ namespace MediaBrowser.Api.Images public void Delete(DeleteUserImage request) { var userId = request.Id; - AssertCanUpdateUser(_authContext, _userManager, userId); + AssertCanUpdateUser(_authContext, _userManager, userId, true); var item = _userManager.GetUserById(userId); diff --git a/MediaBrowser.Api/TvShowsService.cs b/MediaBrowser.Api/TvShowsService.cs index 126f1c7539..bc2b08384e 100644 --- a/MediaBrowser.Api/TvShowsService.cs +++ b/MediaBrowser.Api/TvShowsService.cs @@ -497,7 +497,7 @@ namespace MediaBrowser.Api } else { - episodes = series.GetSeasonEpisodes(season, user); + episodes = season.GetEpisodes(user); } } else diff --git a/MediaBrowser.Api/UserService.cs b/MediaBrowser.Api/UserService.cs index fde03e1f2c..49b7f6c15e 100644 --- a/MediaBrowser.Api/UserService.cs +++ b/MediaBrowser.Api/UserService.cs @@ -444,7 +444,7 @@ namespace MediaBrowser.Api public async Task PostAsync(UpdateUserPassword request) { - AssertCanUpdateUser(_authContext, _userManager, request.Id); + AssertCanUpdateUser(_authContext, _userManager, request.Id, true); var user = _userManager.GetUserById(request.Id); @@ -482,7 +482,7 @@ namespace MediaBrowser.Api public async Task PostAsync(UpdateUserEasyPassword request) { - AssertCanUpdateUser(_authContext, _userManager, request.Id); + AssertCanUpdateUser(_authContext, _userManager, request.Id, true); var user = _userManager.GetUserById(request.Id); @@ -518,7 +518,7 @@ namespace MediaBrowser.Api // https://code.google.com/p/servicestack/source/browse/trunk/Common/ServiceStack.Text/ServiceStack.Text/Controller/PathInfo.cs var id = GetPathValue(1); - AssertCanUpdateUser(_authContext, _userManager, id); + AssertCanUpdateUser(_authContext, _userManager, id, false); var dtoUser = request; @@ -568,7 +568,7 @@ namespace MediaBrowser.Api public void Post(UpdateUserConfiguration request) { - AssertCanUpdateUser(_authContext, _userManager, request.Id); + AssertCanUpdateUser(_authContext, _userManager, request.Id, false); var task = _userManager.UpdateConfiguration(request.Id, request); diff --git a/MediaBrowser.Controller/MediaEncoding/EncodingHelper.cs b/MediaBrowser.Controller/MediaEncoding/EncodingHelper.cs index 22d09f34a1..d6e4a61e42 100644 --- a/MediaBrowser.Controller/MediaEncoding/EncodingHelper.cs +++ b/MediaBrowser.Controller/MediaEncoding/EncodingHelper.cs @@ -1725,6 +1725,11 @@ namespace MediaBrowser.Controller.MediaEncoding if (state.VideoStream != null && !string.IsNullOrWhiteSpace(state.VideoStream.Codec)) { + if (!string.IsNullOrWhiteSpace(encodingOptions.HardwareAccelerationType)) + { + return "-hwaccel auto"; + } + if (string.Equals(encodingOptions.HardwareAccelerationType, "qsv", StringComparison.OrdinalIgnoreCase)) { switch (state.MediaSource.VideoStream.Codec.ToLower()) diff --git a/MediaBrowser.MediaEncoding/Encoder/MediaEncoder.cs b/MediaBrowser.MediaEncoding/Encoder/MediaEncoder.cs index 816f14f821..130afa3e3c 100644 --- a/MediaBrowser.MediaEncoding/Encoder/MediaEncoder.cs +++ b/MediaBrowser.MediaEncoding/Encoder/MediaEncoder.cs @@ -49,11 +49,6 @@ namespace MediaBrowser.MediaEncoding.Encoder /// private readonly SemaphoreSlim _thumbnailResourcePool = new SemaphoreSlim(1, 1); - /// - /// The FF probe resource pool - /// - private readonly SemaphoreSlim _ffProbeResourcePool = new SemaphoreSlim(2, 2); - public string FFMpegPath { get; private set; } public string FFProbePath { get; private set; } @@ -591,20 +586,7 @@ namespace MediaBrowser.MediaEncoding.Encoder using (var processWrapper = new ProcessWrapper(process, this, _logger)) { - await _ffProbeResourcePool.WaitAsync(cancellationToken).ConfigureAwait(false); - - try - { - StartProcess(processWrapper); - } - catch (Exception ex) - { - _ffProbeResourcePool.Release(); - - _logger.ErrorException("Error starting ffprobe", ex); - - throw; - } + StartProcess(processWrapper); try { @@ -655,10 +637,6 @@ namespace MediaBrowser.MediaEncoding.Encoder throw; } - finally - { - _ffProbeResourcePool.Release(); - } } } diff --git a/MediaBrowser.MediaEncoding/Subtitles/SubtitleEncoder.cs b/MediaBrowser.MediaEncoding/Subtitles/SubtitleEncoder.cs index 231a2ae85e..3f2ecae317 100644 --- a/MediaBrowser.MediaEncoding/Subtitles/SubtitleEncoder.cs +++ b/MediaBrowser.MediaEncoding/Subtitles/SubtitleEncoder.cs @@ -524,8 +524,7 @@ namespace MediaBrowser.MediaEncoding.Subtitles { if (!_fileSystem.FileExists(outputPath)) { - await ExtractTextSubtitleInternal(_mediaEncoder.GetInputArgument(inputFiles, protocol), subtitleStreamIndex, - outputCodec, outputPath, cancellationToken).ConfigureAwait(false); + await ExtractTextSubtitleInternal(_mediaEncoder.GetInputArgument(inputFiles, protocol), subtitleStreamIndex, outputCodec, outputPath, cancellationToken).ConfigureAwait(false); } } finally From 1a601e32fd3a29e26f693a7a43c06f2f5f9986ca Mon Sep 17 00:00:00 2001 From: Luke Pulverenti Date: Fri, 21 Apr 2017 16:03:41 -0400 Subject: [PATCH 03/43] 3.2.13.2 --- SharedVersion.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/SharedVersion.cs b/SharedVersion.cs index 25883d0be6..3078419bb2 100644 --- a/SharedVersion.cs +++ b/SharedVersion.cs @@ -1,3 +1,3 @@ using System.Reflection; -[assembly: AssemblyVersion("3.2.13.1")] +[assembly: AssemblyVersion("3.2.13.2")] From d7d5294ab5ec53429a906792ef8e7041cbdcd429 Mon Sep 17 00:00:00 2001 From: Luke Pulverenti Date: Fri, 21 Apr 2017 18:51:33 -0400 Subject: [PATCH 04/43] rework image libs --- .../MediaBrowser.Server.Mono.csproj | 1 + .../MediaBrowser.Server.Startup.Common.csproj | 13 ------------- .../ImageEncoderHelper.cs | 0 .../MediaBrowser.ServerApplication.csproj | 1 + 4 files changed, 2 insertions(+), 13 deletions(-) rename {MediaBrowser.Server.Startup.Common => MediaBrowser.ServerApplication}/ImageEncoderHelper.cs (100%) diff --git a/MediaBrowser.Server.Mono/MediaBrowser.Server.Mono.csproj b/MediaBrowser.Server.Mono/MediaBrowser.Server.Mono.csproj index 17d9767f6b..bcdfa858ff 100644 --- a/MediaBrowser.Server.Mono/MediaBrowser.Server.Mono.csproj +++ b/MediaBrowser.Server.Mono/MediaBrowser.Server.Mono.csproj @@ -117,6 +117,7 @@ Properties\SharedVersion.cs + diff --git a/MediaBrowser.Server.Startup.Common/MediaBrowser.Server.Startup.Common.csproj b/MediaBrowser.Server.Startup.Common/MediaBrowser.Server.Startup.Common.csproj index 5eb4921665..9a6cc2d6e4 100644 --- a/MediaBrowser.Server.Startup.Common/MediaBrowser.Server.Startup.Common.csproj +++ b/MediaBrowser.Server.Startup.Common/MediaBrowser.Server.Startup.Common.csproj @@ -73,25 +73,12 @@ - - - {6cfee013-6e7c-432b-ac37-cabf0880c69a} - Emby.Drawing.ImageMagick - - - {c97a239e-a96c-4d64-a844-ccf8cc30aecb} - Emby.Drawing.Net - - - {08fff49b-f175-4807-a2b5-73b0ebd9f716} - Emby.Drawing - {e383961b-9356-4d5d-8233-9a1079d03055} Emby.Server.Implementations diff --git a/MediaBrowser.Server.Startup.Common/ImageEncoderHelper.cs b/MediaBrowser.ServerApplication/ImageEncoderHelper.cs similarity index 100% rename from MediaBrowser.Server.Startup.Common/ImageEncoderHelper.cs rename to MediaBrowser.ServerApplication/ImageEncoderHelper.cs diff --git a/MediaBrowser.ServerApplication/MediaBrowser.ServerApplication.csproj b/MediaBrowser.ServerApplication/MediaBrowser.ServerApplication.csproj index b968c2fb62..749468fe2b 100644 --- a/MediaBrowser.ServerApplication/MediaBrowser.ServerApplication.csproj +++ b/MediaBrowser.ServerApplication/MediaBrowser.ServerApplication.csproj @@ -135,6 +135,7 @@ Component + Form From 463b41354fde6f70d11b17de4ee8f7b643c55485 Mon Sep 17 00:00:00 2001 From: Luke Pulverenti Date: Sat, 22 Apr 2017 15:32:24 -0400 Subject: [PATCH 05/43] restore missing file --- .../Playback/Hls/DynamicHlsService.cs | 2 +- MediaBrowser.Api/StartupWizardService.cs | 1 + .../Entities/Movies/BoxSet.cs | 2 +- .../LiveTv/LiveTvChannel.cs | 6 ++- .../MediaEncoding/EncodingHelper.cs | 2 +- .../Configuration/ServerConfiguration.cs | 2 + .../ImageEncoderHelper.cs | 48 +++++++++++++++++++ 7 files changed, 59 insertions(+), 4 deletions(-) create mode 100644 MediaBrowser.Server.Mono/ImageEncoderHelper.cs diff --git a/MediaBrowser.Api/Playback/Hls/DynamicHlsService.cs b/MediaBrowser.Api/Playback/Hls/DynamicHlsService.cs index 038d762456..a4ff03c155 100644 --- a/MediaBrowser.Api/Playback/Hls/DynamicHlsService.cs +++ b/MediaBrowser.Api/Playback/Hls/DynamicHlsService.cs @@ -807,7 +807,7 @@ namespace MediaBrowser.Api.Playback.Hls if (string.Equals(codec, "copy", StringComparison.OrdinalIgnoreCase)) { - return "-codec:a:0 copy"; + return "-codec:a:0 copy -copypriorss:a:0 0"; } var args = "-codec:a:0 " + codec; diff --git a/MediaBrowser.Api/StartupWizardService.cs b/MediaBrowser.Api/StartupWizardService.cs index 5a1074b7b7..111e552f25 100644 --- a/MediaBrowser.Api/StartupWizardService.cs +++ b/MediaBrowser.Api/StartupWizardService.cs @@ -101,6 +101,7 @@ namespace MediaBrowser.Api config.EnableLocalizedGuids = true; config.EnableSimpleArtistDetection = true; config.EnableNormalizedItemByNameIds = true; + config.DisableLiveTvChannelUserDataName = true; } public void Post(UpdateStartupConfiguration request) diff --git a/MediaBrowser.Controller/Entities/Movies/BoxSet.cs b/MediaBrowser.Controller/Entities/Movies/BoxSet.cs index 030831717a..8ddf363277 100644 --- a/MediaBrowser.Controller/Entities/Movies/BoxSet.cs +++ b/MediaBrowser.Controller/Entities/Movies/BoxSet.cs @@ -205,7 +205,7 @@ namespace MediaBrowser.Controller.Entities.Movies if (base.IsVisible(user)) { - return GetChildren(user, true).Any(); + return base.GetChildren(user, true).Any(); } return false; diff --git a/MediaBrowser.Controller/LiveTv/LiveTvChannel.cs b/MediaBrowser.Controller/LiveTv/LiveTvChannel.cs index fede81faf4..6e2fe2495a 100644 --- a/MediaBrowser.Controller/LiveTv/LiveTvChannel.cs +++ b/MediaBrowser.Controller/LiveTv/LiveTvChannel.cs @@ -16,7 +16,11 @@ namespace MediaBrowser.Controller.LiveTv { var list = base.GetUserDataKeys(); - list.Insert(0, GetClientTypeName() + "-" + Name); + if (!ConfigurationManager.Configuration.DisableLiveTvChannelUserDataName) + { + list.Insert(0, GetClientTypeName() + "-" + Name); + } + return list; } diff --git a/MediaBrowser.Controller/MediaEncoding/EncodingHelper.cs b/MediaBrowser.Controller/MediaEncoding/EncodingHelper.cs index d6e4a61e42..2441ee0ec9 100644 --- a/MediaBrowser.Controller/MediaEncoding/EncodingHelper.cs +++ b/MediaBrowser.Controller/MediaEncoding/EncodingHelper.cs @@ -732,7 +732,7 @@ namespace MediaBrowser.Controller.MediaEncoding if (string.Equals(videoEncoder, "libx264", StringComparison.OrdinalIgnoreCase)) { - param += " -x264opts:0 subme=0:rc_lookahead=10:me_range=4:me=dia:no_chroma_me:8x8dct=0:partitions=none"; + param += " -x264opts:0 subme=0:me_range=4:rc_lookahead=10:me=dia:no_chroma_me:8x8dct=0:partitions=none"; } if (!string.Equals(videoEncoder, "h264_omx", StringComparison.OrdinalIgnoreCase) && diff --git a/MediaBrowser.Model/Configuration/ServerConfiguration.cs b/MediaBrowser.Model/Configuration/ServerConfiguration.cs index 9d795cfab3..a924ad76e5 100644 --- a/MediaBrowser.Model/Configuration/ServerConfiguration.cs +++ b/MediaBrowser.Model/Configuration/ServerConfiguration.cs @@ -68,6 +68,8 @@ namespace MediaBrowser.Model.Configuration /// true if [enable case sensitive item ids]; otherwise, false. public bool EnableCaseSensitiveItemIds { get; set; } + public bool DisableLiveTvChannelUserDataName { get; set; } + /// /// Gets or sets the metadata path. /// diff --git a/MediaBrowser.Server.Mono/ImageEncoderHelper.cs b/MediaBrowser.Server.Mono/ImageEncoderHelper.cs new file mode 100644 index 0000000000..ddbde2f666 --- /dev/null +++ b/MediaBrowser.Server.Mono/ImageEncoderHelper.cs @@ -0,0 +1,48 @@ +using System; +using Emby.Drawing; +using Emby.Drawing.Net; +using Emby.Drawing.ImageMagick; +using Emby.Server.Core; +using Emby.Server.Implementations; +using MediaBrowser.Common.Configuration; +using MediaBrowser.Common.Net; +using MediaBrowser.Controller.Drawing; +using MediaBrowser.Model.IO; +using MediaBrowser.Model.Logging; + +namespace MediaBrowser.Server.Startup.Common +{ + public class ImageEncoderHelper + { + public static IImageEncoder GetImageEncoder(ILogger logger, + ILogManager logManager, + IFileSystem fileSystem, + StartupOptions startupOptions, + Func httpClient, + IApplicationPaths appPaths) + { + if (!startupOptions.ContainsOption("-enablegdi")) + { + try + { + return new ImageMagickEncoder(logManager.GetLogger("ImageMagick"), appPaths, httpClient, fileSystem); + } + catch + { + logger.Error("Error loading ImageMagick. Will revert to GDI."); + } + } + + try + { + return new GDIImageEncoder(fileSystem, logManager.GetLogger("GDI")); + } + catch + { + logger.Error("Error loading GDI. Will revert to NullImageEncoder."); + } + + return new NullImageEncoder(); + } + } +} From c34ff57e1c188e3eda57a626077e804b36665dff Mon Sep 17 00:00:00 2001 From: Luke Pulverenti Date: Sun, 23 Apr 2017 17:25:00 -0400 Subject: [PATCH 06/43] 3.2.13.3 --- SharedVersion.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/SharedVersion.cs b/SharedVersion.cs index 3078419bb2..d66e54553c 100644 --- a/SharedVersion.cs +++ b/SharedVersion.cs @@ -1,3 +1,3 @@ using System.Reflection; -[assembly: AssemblyVersion("3.2.13.2")] +[assembly: AssemblyVersion("3.2.13.3")] From 491886632dc33e735b0e5f7c88d109eab1eb2a37 Mon Sep 17 00:00:00 2001 From: Luke Pulverenti Date: Tue, 25 Apr 2017 14:23:20 -0400 Subject: [PATCH 07/43] update remote control responses --- Emby.Server.Implementations/Dto/DtoService.cs | 2 +- Emby.Server.Implementations/Library/UserManager.cs | 3 ++- Emby.Server.Implementations/LiveTv/EmbyTV/EmbyTV.cs | 2 +- Emby.Server.Implementations/Session/SessionManager.cs | 3 ++- MediaBrowser.Controller/Library/PlaybackProgressEventArgs.cs | 1 + MediaBrowser.Model/Session/GeneralCommandType.cs | 3 ++- MediaBrowser.Model/Users/UserPolicy.cs | 2 -- 7 files changed, 9 insertions(+), 7 deletions(-) diff --git a/Emby.Server.Implementations/Dto/DtoService.cs b/Emby.Server.Implementations/Dto/DtoService.cs index 7c0baf9c25..43a1e6e694 100644 --- a/Emby.Server.Implementations/Dto/DtoService.cs +++ b/Emby.Server.Implementations/Dto/DtoService.cs @@ -499,7 +499,7 @@ namespace Emby.Server.Implementations.Dto if (fields.Contains(ItemFields.BasicSyncInfo) || fields.Contains(ItemFields.SyncInfo)) { - var userCanSync = user != null && user.Policy.EnableSync; + var userCanSync = user != null && user.Policy.EnableContentDownloading; if (userCanSync && _syncManager.SupportsSync(item)) { dto.SupportsSync = true; diff --git a/Emby.Server.Implementations/Library/UserManager.cs b/Emby.Server.Implementations/Library/UserManager.cs index 89b7198ca2..c2ab0427d3 100644 --- a/Emby.Server.Implementations/Library/UserManager.cs +++ b/Emby.Server.Implementations/Library/UserManager.cs @@ -942,7 +942,8 @@ namespace Emby.Server.Implementations.Library { return new UserPolicy { - EnableSync = true + EnableContentDownloading = true, + EnableSyncTranscoding = true }; } diff --git a/Emby.Server.Implementations/LiveTv/EmbyTV/EmbyTV.cs b/Emby.Server.Implementations/LiveTv/EmbyTV/EmbyTV.cs index 5082f1b044..2fb35155d1 100644 --- a/Emby.Server.Implementations/LiveTv/EmbyTV/EmbyTV.cs +++ b/Emby.Server.Implementations/LiveTv/EmbyTV/EmbyTV.cs @@ -422,7 +422,7 @@ namespace Emby.Server.Implementations.LiveTv.EmbyTV { if (!string.IsNullOrWhiteSpace(epgChannel.Name)) { - tunerChannel.Name = epgChannel.Name; + //tunerChannel.Name = epgChannel.Name; } if (!string.IsNullOrWhiteSpace(epgChannel.ImageUrl)) { diff --git a/Emby.Server.Implementations/Session/SessionManager.cs b/Emby.Server.Implementations/Session/SessionManager.cs index 0a2312735f..de00cf2391 100644 --- a/Emby.Server.Implementations/Session/SessionManager.cs +++ b/Emby.Server.Implementations/Session/SessionManager.cs @@ -715,7 +715,8 @@ namespace Emby.Server.Implementations.Session ClientName = session.Client, DeviceId = session.DeviceId, IsPaused = info.IsPaused, - PlaySessionId = info.PlaySessionId + PlaySessionId = info.PlaySessionId, + IsAutomated = isAutomated }, _logger); diff --git a/MediaBrowser.Controller/Library/PlaybackProgressEventArgs.cs b/MediaBrowser.Controller/Library/PlaybackProgressEventArgs.cs index bcf39558e1..0644719b64 100644 --- a/MediaBrowser.Controller/Library/PlaybackProgressEventArgs.cs +++ b/MediaBrowser.Controller/Library/PlaybackProgressEventArgs.cs @@ -16,6 +16,7 @@ namespace MediaBrowser.Controller.Library public BaseItemInfo MediaInfo { get; set; } public string MediaSourceId { get; set; } public bool IsPaused { get; set; } + public bool IsAutomated { get; set; } public string DeviceId { get; set; } public string DeviceName { get; set; } diff --git a/MediaBrowser.Model/Session/GeneralCommandType.cs b/MediaBrowser.Model/Session/GeneralCommandType.cs index 6cceb162a4..1a96515599 100644 --- a/MediaBrowser.Model/Session/GeneralCommandType.cs +++ b/MediaBrowser.Model/Session/GeneralCommandType.cs @@ -37,6 +37,7 @@ SetRepeatMode = 29, ChannelUp = 30, ChannelDown = 31, - SetMaxStreamingBitrate = 31 + SetMaxStreamingBitrate = 31, + Guide = 32 } } \ No newline at end of file diff --git a/MediaBrowser.Model/Users/UserPolicy.cs b/MediaBrowser.Model/Users/UserPolicy.cs index 3917b1662d..2a987ceb14 100644 --- a/MediaBrowser.Model/Users/UserPolicy.cs +++ b/MediaBrowser.Model/Users/UserPolicy.cs @@ -50,7 +50,6 @@ namespace MediaBrowser.Model.Users /// Gets or sets a value indicating whether [enable synchronize]. /// /// true if [enable synchronize]; otherwise, false. - public bool EnableSync { get; set; } public bool EnableSyncTranscoding { get; set; } public string[] EnabledDevices { get; set; } @@ -71,7 +70,6 @@ namespace MediaBrowser.Model.Users public UserPolicy() { - EnableSync = true; EnableSyncTranscoding = true; EnableMediaPlayback = true; From 28e6f8cbd882627297aab45430c148f7b1a1a340 Mon Sep 17 00:00:00 2001 From: Luke Pulverenti Date: Tue, 25 Apr 2017 14:23:38 -0400 Subject: [PATCH 08/43] update hls authentication --- MediaBrowser.Api/Playback/Hls/BaseHlsService.cs | 3 --- MediaBrowser.Api/Playback/Hls/DynamicHlsService.cs | 1 + MediaBrowser.Api/Playback/Hls/HlsSegmentService.cs | 1 + MediaBrowser.Api/Playback/Hls/VideoHlsService.cs | 1 + MediaBrowser.Api/Playback/Progressive/VideoService.cs | 2 ++ MediaBrowser.Api/Session/SessionInfoWebSocketListener.cs | 2 +- 6 files changed, 6 insertions(+), 4 deletions(-) diff --git a/MediaBrowser.Api/Playback/Hls/BaseHlsService.cs b/MediaBrowser.Api/Playback/Hls/BaseHlsService.cs index 53813860a8..8559bae89d 100644 --- a/MediaBrowser.Api/Playback/Hls/BaseHlsService.cs +++ b/MediaBrowser.Api/Playback/Hls/BaseHlsService.cs @@ -13,10 +13,7 @@ using System.IO; using System.Text; using System.Threading; using System.Threading.Tasks; -using MediaBrowser.Common.IO; -using MediaBrowser.Controller.IO; using MediaBrowser.Controller.Net; -using MediaBrowser.Model.IO; namespace MediaBrowser.Api.Playback.Hls { diff --git a/MediaBrowser.Api/Playback/Hls/DynamicHlsService.cs b/MediaBrowser.Api/Playback/Hls/DynamicHlsService.cs index a4ff03c155..b4618fb87d 100644 --- a/MediaBrowser.Api/Playback/Hls/DynamicHlsService.cs +++ b/MediaBrowser.Api/Playback/Hls/DynamicHlsService.cs @@ -89,6 +89,7 @@ namespace MediaBrowser.Api.Playback.Hls public string SegmentId { get; set; } } + [Authenticated] public class DynamicHlsService : BaseHlsService { diff --git a/MediaBrowser.Api/Playback/Hls/HlsSegmentService.cs b/MediaBrowser.Api/Playback/Hls/HlsSegmentService.cs index ae049a83a4..95109a07f0 100644 --- a/MediaBrowser.Api/Playback/Hls/HlsSegmentService.cs +++ b/MediaBrowser.Api/Playback/Hls/HlsSegmentService.cs @@ -76,6 +76,7 @@ namespace MediaBrowser.Api.Playback.Hls public string SegmentId { get; set; } } + [Authenticated] public class HlsSegmentService : BaseApiService { private readonly IServerApplicationPaths _appPaths; diff --git a/MediaBrowser.Api/Playback/Hls/VideoHlsService.cs b/MediaBrowser.Api/Playback/Hls/VideoHlsService.cs index a813d7a872..22c6202e4f 100644 --- a/MediaBrowser.Api/Playback/Hls/VideoHlsService.cs +++ b/MediaBrowser.Api/Playback/Hls/VideoHlsService.cs @@ -20,6 +20,7 @@ namespace MediaBrowser.Api.Playback.Hls /// /// Class VideoHlsService /// + [Authenticated] public class VideoHlsService : BaseHlsService { public object Get(GetLiveHlsStream request) diff --git a/MediaBrowser.Api/Playback/Progressive/VideoService.cs b/MediaBrowser.Api/Playback/Progressive/VideoService.cs index 8394e016cc..c36a27690a 100644 --- a/MediaBrowser.Api/Playback/Progressive/VideoService.cs +++ b/MediaBrowser.Api/Playback/Progressive/VideoService.cs @@ -62,6 +62,8 @@ namespace MediaBrowser.Api.Playback.Progressive /// /// Class VideoService /// + // TODO: In order to autheneticate this in the future, Dlna playback will require updating + //[Authenticated] public class VideoService : BaseProgressiveStreamingService { public VideoService(IServerConfigurationManager serverConfig, IUserManager userManager, ILibraryManager libraryManager, IIsoManager isoManager, IMediaEncoder mediaEncoder, IFileSystem fileSystem, IDlnaManager dlnaManager, ISubtitleEncoder subtitleEncoder, IDeviceManager deviceManager, IMediaSourceManager mediaSourceManager, IZipClient zipClient, IJsonSerializer jsonSerializer, IAuthorizationContext authorizationContext, IImageProcessor imageProcessor) : base(serverConfig, userManager, libraryManager, isoManager, mediaEncoder, fileSystem, dlnaManager, subtitleEncoder, deviceManager, mediaSourceManager, zipClient, jsonSerializer, authorizationContext, imageProcessor) diff --git a/MediaBrowser.Api/Session/SessionInfoWebSocketListener.cs b/MediaBrowser.Api/Session/SessionInfoWebSocketListener.cs index b90a718529..e133a88a1f 100644 --- a/MediaBrowser.Api/Session/SessionInfoWebSocketListener.cs +++ b/MediaBrowser.Api/Session/SessionInfoWebSocketListener.cs @@ -58,7 +58,7 @@ namespace MediaBrowser.Api.Session void _sessionManager_PlaybackProgress(object sender, PlaybackProgressEventArgs e) { - SendData(false); + SendData(!e.IsAutomated); } void _sessionManager_PlaybackStopped(object sender, PlaybackStopEventArgs e) From f13696868fd87924441a732e703350b56ae6ad7b Mon Sep 17 00:00:00 2001 From: Luke Pulverenti Date: Tue, 25 Apr 2017 14:24:15 -0400 Subject: [PATCH 09/43] 3.2.13.4 --- SharedVersion.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/SharedVersion.cs b/SharedVersion.cs index d66e54553c..67aa785ec6 100644 --- a/SharedVersion.cs +++ b/SharedVersion.cs @@ -1,3 +1,3 @@ using System.Reflection; -[assembly: AssemblyVersion("3.2.13.3")] +[assembly: AssemblyVersion("3.2.13.4")] From ffb935700cc2d9ac47a81e43cf2187ff8c78957a Mon Sep 17 00:00:00 2001 From: Luke Pulverenti Date: Thu, 27 Apr 2017 14:11:56 -0400 Subject: [PATCH 10/43] update mono unhandled exception handler --- .../Logging/UnhandledExceptionWriter.cs | 6 ++++-- MediaBrowser.Server.Mono/Program.cs | 7 ++++++- MediaBrowser.Server.Mono/app.config | 2 ++ 3 files changed, 12 insertions(+), 3 deletions(-) diff --git a/Emby.Server.Implementations/Logging/UnhandledExceptionWriter.cs b/Emby.Server.Implementations/Logging/UnhandledExceptionWriter.cs index 5183f3a0b6..6e96d83fd3 100644 --- a/Emby.Server.Implementations/Logging/UnhandledExceptionWriter.cs +++ b/Emby.Server.Implementations/Logging/UnhandledExceptionWriter.cs @@ -35,9 +35,11 @@ namespace Emby.Server.Implementations.Logging // Write to console just in case file logging fails _console.WriteLine("UnhandledException"); - _console.WriteLine(builder.ToString()); - _fileSystem.WriteAllText(path, builder.ToString()); + var logMessage = builder.ToString(); + _console.WriteLine(logMessage); + + _fileSystem.WriteAllText(path, logMessage); } } } diff --git a/MediaBrowser.Server.Mono/Program.cs b/MediaBrowser.Server.Mono/Program.cs index 66851f7e94..dcd2dcaa67 100644 --- a/MediaBrowser.Server.Mono/Program.cs +++ b/MediaBrowser.Server.Mono/Program.cs @@ -258,7 +258,12 @@ namespace MediaBrowser.Server.Mono if (!Debugger.IsAttached) { - Environment.Exit(System.Runtime.InteropServices.Marshal.GetHRForException(exception)); + var message = LogHelper.GetLogMessage(exception).ToString(); + + if (message.IndexOf("InotifyWatcher", StringComparison.OrdinalIgnoreCase) == -1) + { + Environment.Exit(System.Runtime.InteropServices.Marshal.GetHRForException(exception)); + } } } diff --git a/MediaBrowser.Server.Mono/app.config b/MediaBrowser.Server.Mono/app.config index 07c113f3e1..8f21d4a67f 100644 --- a/MediaBrowser.Server.Mono/app.config +++ b/MediaBrowser.Server.Mono/app.config @@ -11,6 +11,8 @@ + + From da39d9a5bf9656f35501c5e11982240192ce34a2 Mon Sep 17 00:00:00 2001 From: Luke Pulverenti Date: Thu, 27 Apr 2017 14:12:44 -0400 Subject: [PATCH 11/43] update folder queries --- .../FileOrganization/EpisodeFileOrganizer.cs | 2 +- .../Library/MusicManager.cs | 85 +++++++------------ .../Entities/Audio/MusicGenre.cs | 2 +- MediaBrowser.Controller/Entities/GameGenre.cs | 2 +- MediaBrowser.Controller/Entities/Genre.cs | 2 +- .../Entities/Movies/BoxSet.cs | 4 +- .../Entities/UserViewBuilder.cs | 29 ++----- MediaBrowser.Controller/Playlists/Playlist.cs | 29 +++---- .../Encoder/EncodingJob.cs | 2 - .../Music/AlbumImageFromSongProvider.cs | 3 +- .../TV/DummySeasonProvider.cs | 4 +- .../TV/MissingEpisodeProvider.cs | 19 +++-- 12 files changed, 69 insertions(+), 114 deletions(-) diff --git a/Emby.Server.Implementations/FileOrganization/EpisodeFileOrganizer.cs b/Emby.Server.Implementations/FileOrganization/EpisodeFileOrganizer.cs index 0a9c67285b..7b64c582a7 100644 --- a/Emby.Server.Implementations/FileOrganization/EpisodeFileOrganizer.cs +++ b/Emby.Server.Implementations/FileOrganization/EpisodeFileOrganizer.cs @@ -470,7 +470,7 @@ namespace Emby.Server.Implementations.FileOrganization return new List(); } - var episodePaths = series.GetRecursiveChildren() + var episodePaths = series.GetRecursiveChildren(i => i is Episode) .OfType() .Where(i => { diff --git a/Emby.Server.Implementations/Library/MusicManager.cs b/Emby.Server.Implementations/Library/MusicManager.cs index 9d07837c69..b15c011254 100644 --- a/Emby.Server.Implementations/Library/MusicManager.cs +++ b/Emby.Server.Implementations/Library/MusicManager.cs @@ -5,6 +5,7 @@ using MediaBrowser.Controller.Playlists; using System; using System.Collections.Generic; using System.Linq; +using MediaBrowser.Model.Querying; namespace Emby.Server.Implementations.Library { @@ -27,53 +28,17 @@ namespace Emby.Server.Implementations.Library return list.Concat(GetInstantMixFromGenres(item.Genres, user)); } - public IEnumerable