diff --git a/MediaBrowser.Api/ScheduledTasks/ScheduledTaskService.cs b/MediaBrowser.Api/ScheduledTasks/ScheduledTaskService.cs index a05be024e..f5b3d173b 100644 --- a/MediaBrowser.Api/ScheduledTasks/ScheduledTaskService.cs +++ b/MediaBrowser.Api/ScheduledTasks/ScheduledTaskService.cs @@ -32,6 +32,9 @@ namespace MediaBrowser.Api.ScheduledTasks { [ApiMember(Name = "IsHidden", Description = "Optional filter tasks that are hidden, or not.", IsRequired = false, DataType = "bool", ParameterType = "query", Verb = "GET")] public bool? IsHidden { get; set; } + + [ApiMember(Name = "IsEnabled", Description = "Optional filter tasks that are enabled, or not.", IsRequired = false, DataType = "bool", ParameterType = "query", Verb = "GET")] + public bool? IsEnabled { get; set; } } /// @@ -132,6 +135,25 @@ namespace MediaBrowser.Api.ScheduledTasks }); } + if (request.IsEnabled.HasValue) + { + var val = request.IsEnabled.Value; + + result = result.Where(i => + { + var isEnabled = false; + + var configurableTask = i.ScheduledTask as IConfigurableScheduledTask; + + if (configurableTask != null) + { + isEnabled = configurableTask.IsEnabled; + } + + return isEnabled == val; + }); + } + var infos = result .Select(ScheduledTaskHelpers.GetTaskInfo) .ToList(); diff --git a/MediaBrowser.Server.Implementations/FileOrganization/OrganizerScheduledTask.cs b/MediaBrowser.Server.Implementations/FileOrganization/OrganizerScheduledTask.cs index 74b994c28..f993e1fc3 100644 --- a/MediaBrowser.Server.Implementations/FileOrganization/OrganizerScheduledTask.cs +++ b/MediaBrowser.Server.Implementations/FileOrganization/OrganizerScheduledTask.cs @@ -54,10 +54,13 @@ namespace MediaBrowser.Server.Implementations.FileOrganization return _config.GetAutoOrganizeOptions().TvOptions; } - public Task Execute(CancellationToken cancellationToken, IProgress progress) + public async Task Execute(CancellationToken cancellationToken, IProgress progress) { - return new TvFolderOrganizer(_libraryManager, _logger, _fileSystem, _libraryMonitor, _organizationService, _config, _providerManager) - .Organize(GetTvOptions(), cancellationToken, progress); + if (GetTvOptions().IsEnabled) + { + await new TvFolderOrganizer(_libraryManager, _logger, _fileSystem, _libraryMonitor, _organizationService, _config, _providerManager) + .Organize(GetTvOptions(), cancellationToken, progress).ConfigureAwait(false); + } } public IEnumerable GetDefaultTriggers() diff --git a/MediaBrowser.Server.Implementations/Localization/Server/server.json b/MediaBrowser.Server.Implementations/Localization/Server/server.json index 3c44adc60..e4677e4d1 100644 --- a/MediaBrowser.Server.Implementations/Localization/Server/server.json +++ b/MediaBrowser.Server.Implementations/Localization/Server/server.json @@ -47,7 +47,7 @@ "LabelDashboardSourcePath": "Web client source path:", "LabelDashboardSourcePathHelp": "If running the server from source, specify the path to the dashboard-ui folder. All web client files will be served from this location.", "ButtonConvertMedia": "Convert media", - "ButtonOrganizeNow": "Organize now", + "ButtonOrganize": "Organize", "ButtonOk": "Ok", "ButtonCancel": "Cancel", "ButtonNew": "New", diff --git a/MediaBrowser.Server.Startup.Common/ApplicationHost.cs b/MediaBrowser.Server.Startup.Common/ApplicationHost.cs index 49cc672ab..f481a902d 100644 --- a/MediaBrowser.Server.Startup.Common/ApplicationHost.cs +++ b/MediaBrowser.Server.Startup.Common/ApplicationHost.cs @@ -532,9 +532,9 @@ namespace MediaBrowser.Server.Startup.Common SetStaticProperties(); - await ((UserManager)UserManager).Initialize().ConfigureAwait(false); - SetKernelProperties(); + + await ((UserManager)UserManager).Initialize().ConfigureAwait(false); } protected override INetworkManager CreateNetworkManager(ILogger logger) diff --git a/MediaBrowser.WebDashboard/Api/PackageCreator.cs b/MediaBrowser.WebDashboard/Api/PackageCreator.cs index aec7a539c..90a5b4ab6 100644 --- a/MediaBrowser.WebDashboard/Api/PackageCreator.cs +++ b/MediaBrowser.WebDashboard/Api/PackageCreator.cs @@ -366,6 +366,7 @@ namespace MediaBrowser.WebDashboard.Api "mediaplayer-video.js", "nowplayingbar.js", "nowplayingpage.js", + "taskbutton.js", "ratingdialog.js", "aboutpage.js", diff --git a/MediaBrowser.WebDashboard/MediaBrowser.WebDashboard.csproj b/MediaBrowser.WebDashboard/MediaBrowser.WebDashboard.csproj index 90a358d5c..1f720eb26 100644 --- a/MediaBrowser.WebDashboard/MediaBrowser.WebDashboard.csproj +++ b/MediaBrowser.WebDashboard/MediaBrowser.WebDashboard.csproj @@ -126,6 +126,9 @@ PreserveNewest + + PreserveNewest + PreserveNewest