separate task buttons script
This commit is contained in:
parent
449485d3d2
commit
9e809b06c4
|
@ -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; }
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
|
@ -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();
|
||||
|
|
|
@ -54,10 +54,13 @@ namespace MediaBrowser.Server.Implementations.FileOrganization
|
|||
return _config.GetAutoOrganizeOptions().TvOptions;
|
||||
}
|
||||
|
||||
public Task Execute(CancellationToken cancellationToken, IProgress<double> progress)
|
||||
public async Task Execute(CancellationToken cancellationToken, IProgress<double> 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<ITaskTrigger> GetDefaultTriggers()
|
||||
|
|
|
@ -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",
|
||||
|
|
|
@ -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)
|
||||
|
|
|
@ -366,6 +366,7 @@ namespace MediaBrowser.WebDashboard.Api
|
|||
"mediaplayer-video.js",
|
||||
"nowplayingbar.js",
|
||||
"nowplayingpage.js",
|
||||
"taskbutton.js",
|
||||
|
||||
"ratingdialog.js",
|
||||
"aboutpage.js",
|
||||
|
|
|
@ -126,6 +126,9 @@
|
|||
<Content Include="dashboard-ui\scripts\syncsettings.js">
|
||||
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
|
||||
</Content>
|
||||
<Content Include="dashboard-ui\scripts\taskbutton.js">
|
||||
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
|
||||
</Content>
|
||||
<Content Include="dashboard-ui\scripts\usernew.js">
|
||||
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
|
||||
</Content>
|
||||
|
|
Loading…
Reference in New Issue
Block a user