mirror of
https://github.com/jellyfin/jellyfin.git
synced 2026-06-05 07:18:47 +01:00
Update to 3.5.2 and .net core 2.1
This commit is contained in:
@@ -65,7 +65,7 @@ namespace Emby.Server.Implementations.ScheduledTasks
|
||||
{
|
||||
Type = TaskTriggerInfo.TriggerDaily,
|
||||
TimeOfDayTicks = TimeSpan.FromHours(2).Ticks,
|
||||
MaxRuntimeMs = Convert.ToInt32(TimeSpan.FromHours(4).TotalMilliseconds)
|
||||
MaxRuntimeTicks = TimeSpan.FromHours(4).Ticks
|
||||
}
|
||||
};
|
||||
}
|
||||
@@ -133,9 +133,9 @@ namespace Emby.Server.Implementations.ScheduledTasks
|
||||
|
||||
try
|
||||
{
|
||||
var chapters = _itemRepo.GetChapters(video.Id);
|
||||
var chapters = _itemRepo.GetChapters(video);
|
||||
|
||||
var success = await _encodingManager.RefreshChapterImages(video, directoryService, chapters, extract, true, CancellationToken.None);
|
||||
var success = await _encodingManager.RefreshChapterImages(video, directoryService, chapters, extract, true, cancellationToken).ConfigureAwait(false);
|
||||
|
||||
if (!success)
|
||||
{
|
||||
|
||||
@@ -18,20 +18,17 @@ namespace Emby.Server.Implementations.ScheduledTasks
|
||||
/// <value>The time of day.</value>
|
||||
public TimeSpan TimeOfDay { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Gets or sets the options of this task.
|
||||
/// </summary>
|
||||
public TaskOptions TaskOptions { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Gets or sets the timer.
|
||||
/// </summary>
|
||||
/// <value>The timer.</value>
|
||||
private Timer Timer { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Gets the execution properties of this task.
|
||||
/// </summary>
|
||||
/// <value>
|
||||
/// The execution properties of this task.
|
||||
/// </value>
|
||||
public TaskExecutionOptions TaskOptions { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Stars waiting for the trigger action
|
||||
/// </summary>
|
||||
@@ -75,7 +72,7 @@ namespace Emby.Server.Implementations.ScheduledTasks
|
||||
/// <summary>
|
||||
/// Occurs when [triggered].
|
||||
/// </summary>
|
||||
public event EventHandler<GenericEventArgs<TaskExecutionOptions>> Triggered;
|
||||
public event EventHandler<EventArgs> Triggered;
|
||||
|
||||
/// <summary>
|
||||
/// Called when [triggered].
|
||||
@@ -84,7 +81,7 @@ namespace Emby.Server.Implementations.ScheduledTasks
|
||||
{
|
||||
if (Triggered != null)
|
||||
{
|
||||
Triggered(this, new GenericEventArgs<TaskExecutionOptions>(TaskOptions));
|
||||
Triggered(this, EventArgs.Empty);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -18,20 +18,17 @@ namespace Emby.Server.Implementations.ScheduledTasks
|
||||
/// <value>The interval.</value>
|
||||
public TimeSpan Interval { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Gets or sets the options of this task.
|
||||
/// </summary>
|
||||
public TaskOptions TaskOptions { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Gets or sets the timer.
|
||||
/// </summary>
|
||||
/// <value>The timer.</value>
|
||||
private Timer Timer { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Gets the execution properties of this task.
|
||||
/// </summary>
|
||||
/// <value>
|
||||
/// The execution properties of this task.
|
||||
/// </value>
|
||||
public TaskExecutionOptions TaskOptions { get; set; }
|
||||
|
||||
private DateTime _lastStartDate;
|
||||
|
||||
/// <summary>
|
||||
@@ -93,7 +90,7 @@ namespace Emby.Server.Implementations.ScheduledTasks
|
||||
/// <summary>
|
||||
/// Occurs when [triggered].
|
||||
/// </summary>
|
||||
public event EventHandler<GenericEventArgs<TaskExecutionOptions>> Triggered;
|
||||
public event EventHandler<EventArgs> Triggered;
|
||||
|
||||
/// <summary>
|
||||
/// Called when [triggered].
|
||||
@@ -105,7 +102,7 @@ namespace Emby.Server.Implementations.ScheduledTasks
|
||||
if (Triggered != null)
|
||||
{
|
||||
_lastStartDate = DateTime.UtcNow;
|
||||
Triggered(this, new GenericEventArgs<TaskExecutionOptions>(TaskOptions));
|
||||
Triggered(this, EventArgs.Empty);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -16,7 +16,7 @@ namespace Emby.Server.Implementations.ScheduledTasks
|
||||
/// <summary>
|
||||
/// Plugin Update Task
|
||||
/// </summary>
|
||||
public class PluginUpdateTask : IScheduledTask
|
||||
public class PluginUpdateTask : IScheduledTask, IConfigurableScheduledTask
|
||||
{
|
||||
/// <summary>
|
||||
/// The _logger
|
||||
@@ -71,14 +71,13 @@ namespace Emby.Server.Implementations.ScheduledTasks
|
||||
|
||||
var numComplete = 0;
|
||||
|
||||
// Create tasks for each one
|
||||
var tasks = packagesToInstall.Select(i => Task.Run(async () =>
|
||||
foreach (var package in packagesToInstall)
|
||||
{
|
||||
cancellationToken.ThrowIfCancellationRequested();
|
||||
|
||||
try
|
||||
{
|
||||
await _installationManager.InstallPackage(i, true, new SimpleProgress<double>(), cancellationToken).ConfigureAwait(false);
|
||||
await _installationManager.InstallPackage(package, true, new SimpleProgress<double>(), cancellationToken).ConfigureAwait(false);
|
||||
}
|
||||
catch (OperationCanceledException)
|
||||
{
|
||||
@@ -90,11 +89,11 @@ namespace Emby.Server.Implementations.ScheduledTasks
|
||||
}
|
||||
catch (HttpException ex)
|
||||
{
|
||||
_logger.ErrorException("Error downloading {0}", ex, i.name);
|
||||
_logger.ErrorException("Error downloading {0}", ex, package.name);
|
||||
}
|
||||
catch (IOException ex)
|
||||
{
|
||||
_logger.ErrorException("Error updating {0}", ex, i.name);
|
||||
_logger.ErrorException("Error updating {0}", ex, package.name);
|
||||
}
|
||||
|
||||
// Update progress
|
||||
@@ -106,11 +105,7 @@ namespace Emby.Server.Implementations.ScheduledTasks
|
||||
|
||||
progress.Report(90 * percent + 10);
|
||||
}
|
||||
}));
|
||||
|
||||
cancellationToken.ThrowIfCancellationRequested();
|
||||
|
||||
await Task.WhenAll(tasks).ConfigureAwait(false);
|
||||
}
|
||||
|
||||
progress.Report(100);
|
||||
}
|
||||
@@ -137,5 +132,11 @@ namespace Emby.Server.Implementations.ScheduledTasks
|
||||
{
|
||||
get { return "Application"; }
|
||||
}
|
||||
|
||||
public bool IsHidden => true;
|
||||
|
||||
public bool IsEnabled => true;
|
||||
|
||||
public bool IsLogged => true;
|
||||
}
|
||||
}
|
||||
@@ -160,7 +160,7 @@ namespace Emby.Server.Implementations.ScheduledTasks
|
||||
_lastExecutionResult = value;
|
||||
|
||||
var path = GetHistoryFilePath();
|
||||
_fileSystem.CreateDirectory(_fileSystem.GetDirectoryName(path));
|
||||
_fileSystem.CreateDirectory(_fileSystem.GetDirectoryName(path));
|
||||
|
||||
lock (_lastExecutionResultSyncLock)
|
||||
{
|
||||
@@ -236,7 +236,7 @@ namespace Emby.Server.Implementations.ScheduledTasks
|
||||
/// <summary>
|
||||
/// The _triggers
|
||||
/// </summary>
|
||||
private Tuple<TaskTriggerInfo,ITaskTrigger>[] _triggers;
|
||||
private Tuple<TaskTriggerInfo, ITaskTrigger>[] _triggers;
|
||||
/// <summary>
|
||||
/// Gets the triggers that define when the task will run
|
||||
/// </summary>
|
||||
@@ -350,7 +350,7 @@ namespace Emby.Server.Implementations.ScheduledTasks
|
||||
/// </summary>
|
||||
/// <param name="sender">The source of the event.</param>
|
||||
/// <param name="e">The <see cref="EventArgs" /> instance containing the event data.</param>
|
||||
async void trigger_Triggered(object sender, GenericEventArgs<TaskExecutionOptions> e)
|
||||
async void trigger_Triggered(object sender, EventArgs e)
|
||||
{
|
||||
var trigger = (ITaskTrigger)sender;
|
||||
|
||||
@@ -365,7 +365,7 @@ namespace Emby.Server.Implementations.ScheduledTasks
|
||||
|
||||
trigger.Stop();
|
||||
|
||||
TaskManager.QueueScheduledTask(ScheduledTask, e.Argument);
|
||||
TaskManager.QueueScheduledTask(ScheduledTask, trigger.TaskOptions);
|
||||
|
||||
await Task.Delay(1000).ConfigureAwait(false);
|
||||
|
||||
@@ -380,7 +380,7 @@ namespace Emby.Server.Implementations.ScheduledTasks
|
||||
/// <param name="options">Task options.</param>
|
||||
/// <returns>Task.</returns>
|
||||
/// <exception cref="System.InvalidOperationException">Cannot execute a Task that is already running</exception>
|
||||
public async Task Execute(TaskExecutionOptions options)
|
||||
public async Task Execute(TaskOptions options)
|
||||
{
|
||||
var task = Task.Run(async () => await ExecuteInternal(options).ConfigureAwait(false));
|
||||
|
||||
@@ -397,7 +397,7 @@ namespace Emby.Server.Implementations.ScheduledTasks
|
||||
}
|
||||
}
|
||||
|
||||
private async Task ExecuteInternal(TaskExecutionOptions options)
|
||||
private async Task ExecuteInternal(TaskOptions options)
|
||||
{
|
||||
// Cancel the current execution, if any
|
||||
if (CurrentCancellationTokenSource != null)
|
||||
@@ -422,14 +422,12 @@ namespace Emby.Server.Implementations.ScheduledTasks
|
||||
|
||||
try
|
||||
{
|
||||
if (options != null && options.MaxRuntimeMs.HasValue)
|
||||
if (options != null && options.MaxRuntimeTicks.HasValue)
|
||||
{
|
||||
CurrentCancellationTokenSource.CancelAfter(options.MaxRuntimeMs.Value);
|
||||
CurrentCancellationTokenSource.CancelAfter(TimeSpan.FromTicks(options.MaxRuntimeTicks.Value));
|
||||
}
|
||||
|
||||
var localTask = ScheduledTask.Execute(CurrentCancellationTokenSource.Token, progress);
|
||||
|
||||
await localTask.ConfigureAwait(false);
|
||||
await ScheduledTask.Execute(CurrentCancellationTokenSource.Token, progress).ConfigureAwait(false);
|
||||
|
||||
status = TaskCompletionStatus.Completed;
|
||||
}
|
||||
@@ -563,13 +561,35 @@ namespace Emby.Server.Implementations.ScheduledTasks
|
||||
catch (FileNotFoundException)
|
||||
{
|
||||
// File doesn't exist. No biggie. Return defaults.
|
||||
return ScheduledTask.GetDefaultTriggers().ToArray();
|
||||
}
|
||||
catch (DirectoryNotFoundException)
|
||||
{
|
||||
// File doesn't exist. No biggie. Return defaults.
|
||||
}
|
||||
return ScheduledTask.GetDefaultTriggers().ToArray();
|
||||
catch
|
||||
{
|
||||
|
||||
}
|
||||
return GetDefaultTriggers();
|
||||
}
|
||||
|
||||
private TaskTriggerInfo[] GetDefaultTriggers()
|
||||
{
|
||||
try
|
||||
{
|
||||
return ScheduledTask.GetDefaultTriggers().ToArray();
|
||||
}
|
||||
catch
|
||||
{
|
||||
return new TaskTriggerInfo[]
|
||||
{
|
||||
new TaskTriggerInfo
|
||||
{
|
||||
IntervalTicks = TimeSpan.FromDays(1).Ticks,
|
||||
Type = TaskTriggerInfo.TriggerInterval
|
||||
}
|
||||
};
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
@@ -580,7 +600,7 @@ namespace Emby.Server.Implementations.ScheduledTasks
|
||||
{
|
||||
var path = GetConfigurationFilePath();
|
||||
|
||||
_fileSystem.CreateDirectory(_fileSystem.GetDirectoryName(path));
|
||||
_fileSystem.CreateDirectory(_fileSystem.GetDirectoryName(path));
|
||||
|
||||
JsonSerializer.SerializeToFile(triggers, path);
|
||||
}
|
||||
@@ -625,7 +645,6 @@ namespace Emby.Server.Implementations.ScheduledTasks
|
||||
public void Dispose()
|
||||
{
|
||||
Dispose(true);
|
||||
GC.SuppressFinalize(this);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
@@ -705,9 +724,9 @@ namespace Emby.Server.Implementations.ScheduledTasks
|
||||
/// <exception cref="System.ArgumentException">Invalid trigger type: + info.Type</exception>
|
||||
private ITaskTrigger GetTrigger(TaskTriggerInfo info)
|
||||
{
|
||||
var options = new TaskExecutionOptions
|
||||
var options = new TaskOptions
|
||||
{
|
||||
MaxRuntimeMs = info.MaxRuntimeMs
|
||||
MaxRuntimeTicks = info.MaxRuntimeTicks
|
||||
};
|
||||
|
||||
if (info.Type.Equals(typeof(DailyTrigger).Name, StringComparison.OrdinalIgnoreCase))
|
||||
|
||||
@@ -14,12 +14,9 @@ namespace Emby.Server.Implementations.ScheduledTasks
|
||||
public int DelayMs { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Gets the execution properties of this task.
|
||||
/// Gets or sets the options of this task.
|
||||
/// </summary>
|
||||
/// <value>
|
||||
/// The execution properties of this task.
|
||||
/// </value>
|
||||
public TaskExecutionOptions TaskOptions { get; set; }
|
||||
public TaskOptions TaskOptions { get; set; }
|
||||
|
||||
public StartupTrigger()
|
||||
{
|
||||
@@ -51,7 +48,7 @@ namespace Emby.Server.Implementations.ScheduledTasks
|
||||
/// <summary>
|
||||
/// Occurs when [triggered].
|
||||
/// </summary>
|
||||
public event EventHandler<GenericEventArgs<TaskExecutionOptions>> Triggered;
|
||||
public event EventHandler<EventArgs> Triggered;
|
||||
|
||||
/// <summary>
|
||||
/// Called when [triggered].
|
||||
@@ -60,7 +57,7 @@ namespace Emby.Server.Implementations.ScheduledTasks
|
||||
{
|
||||
if (Triggered != null)
|
||||
{
|
||||
Triggered(this, new GenericEventArgs<TaskExecutionOptions>(TaskOptions));
|
||||
Triggered(this, EventArgs.Empty);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -19,12 +19,9 @@ namespace Emby.Server.Implementations.ScheduledTasks
|
||||
public SystemEvent SystemEvent { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Gets the execution properties of this task.
|
||||
/// Gets or sets the options of this task.
|
||||
/// </summary>
|
||||
/// <value>
|
||||
/// The execution properties of this task.
|
||||
/// </value>
|
||||
public TaskExecutionOptions TaskOptions { get; set; }
|
||||
public TaskOptions TaskOptions { get; set; }
|
||||
|
||||
private readonly ISystemEvents _systemEvents;
|
||||
|
||||
@@ -70,7 +67,7 @@ namespace Emby.Server.Implementations.ScheduledTasks
|
||||
/// <summary>
|
||||
/// Occurs when [triggered].
|
||||
/// </summary>
|
||||
public event EventHandler<GenericEventArgs<TaskExecutionOptions>> Triggered;
|
||||
public event EventHandler<EventArgs> Triggered;
|
||||
|
||||
/// <summary>
|
||||
/// Called when [triggered].
|
||||
@@ -79,7 +76,7 @@ namespace Emby.Server.Implementations.ScheduledTasks
|
||||
{
|
||||
if (Triggered != null)
|
||||
{
|
||||
Triggered(this, new GenericEventArgs<TaskExecutionOptions>(TaskOptions));
|
||||
Triggered(this, EventArgs.Empty);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -32,8 +32,8 @@ namespace Emby.Server.Implementations.ScheduledTasks
|
||||
/// <summary>
|
||||
/// The _task queue
|
||||
/// </summary>
|
||||
private readonly ConcurrentQueue<Tuple<Type, TaskExecutionOptions>> _taskQueue =
|
||||
new ConcurrentQueue<Tuple<Type, TaskExecutionOptions>>();
|
||||
private readonly ConcurrentQueue<Tuple<Type, TaskOptions>> _taskQueue =
|
||||
new ConcurrentQueue<Tuple<Type, TaskOptions>>();
|
||||
|
||||
/// <summary>
|
||||
/// Gets or sets the json serializer.
|
||||
@@ -114,6 +114,10 @@ namespace Emby.Server.Implementations.ScheduledTasks
|
||||
{
|
||||
var path = Path.Combine(ApplicationPaths.CachePath, "startuptasks.txt");
|
||||
|
||||
// ToDo: Fix this shit
|
||||
if (!File.Exists(path))
|
||||
return;
|
||||
|
||||
List<string> lines;
|
||||
|
||||
try
|
||||
@@ -126,7 +130,7 @@ namespace Emby.Server.Implementations.ScheduledTasks
|
||||
|
||||
if (task != null)
|
||||
{
|
||||
QueueScheduledTask(task, new TaskExecutionOptions());
|
||||
QueueScheduledTask(task, new TaskOptions());
|
||||
}
|
||||
}
|
||||
|
||||
@@ -143,7 +147,7 @@ namespace Emby.Server.Implementations.ScheduledTasks
|
||||
/// </summary>
|
||||
/// <typeparam name="T"></typeparam>
|
||||
/// <param name="options">Task options.</param>
|
||||
public void CancelIfRunningAndQueue<T>(TaskExecutionOptions options)
|
||||
public void CancelIfRunningAndQueue<T>(TaskOptions options)
|
||||
where T : IScheduledTask
|
||||
{
|
||||
var task = ScheduledTasks.First(t => t.ScheduledTask.GetType() == typeof(T));
|
||||
@@ -155,7 +159,7 @@ namespace Emby.Server.Implementations.ScheduledTasks
|
||||
public void CancelIfRunningAndQueue<T>()
|
||||
where T : IScheduledTask
|
||||
{
|
||||
CancelIfRunningAndQueue<T>(new TaskExecutionOptions());
|
||||
CancelIfRunningAndQueue<T>(new TaskOptions());
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
@@ -174,7 +178,7 @@ namespace Emby.Server.Implementations.ScheduledTasks
|
||||
/// </summary>
|
||||
/// <typeparam name="T"></typeparam>
|
||||
/// <param name="options">Task options</param>
|
||||
public void QueueScheduledTask<T>(TaskExecutionOptions options)
|
||||
public void QueueScheduledTask<T>(TaskOptions options)
|
||||
where T : IScheduledTask
|
||||
{
|
||||
var scheduledTask = ScheduledTasks.FirstOrDefault(t => t.ScheduledTask.GetType() == typeof(T));
|
||||
@@ -192,7 +196,7 @@ namespace Emby.Server.Implementations.ScheduledTasks
|
||||
public void QueueScheduledTask<T>()
|
||||
where T : IScheduledTask
|
||||
{
|
||||
QueueScheduledTask<T>(new TaskExecutionOptions());
|
||||
QueueScheduledTask<T>(new TaskOptions());
|
||||
}
|
||||
|
||||
public void QueueIfNotRunning<T>()
|
||||
@@ -202,7 +206,7 @@ namespace Emby.Server.Implementations.ScheduledTasks
|
||||
|
||||
if (task.State != TaskState.Running)
|
||||
{
|
||||
QueueScheduledTask<T>(new TaskExecutionOptions());
|
||||
QueueScheduledTask<T>(new TaskOptions());
|
||||
}
|
||||
}
|
||||
|
||||
@@ -225,7 +229,7 @@ namespace Emby.Server.Implementations.ScheduledTasks
|
||||
{
|
||||
if (scheduledTask.State == TaskState.Idle)
|
||||
{
|
||||
Execute(scheduledTask, new TaskExecutionOptions());
|
||||
Execute(scheduledTask, new TaskOptions());
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -236,7 +240,7 @@ namespace Emby.Server.Implementations.ScheduledTasks
|
||||
/// </summary>
|
||||
/// <param name="task">The task.</param>
|
||||
/// <param name="options">The task options.</param>
|
||||
public void QueueScheduledTask(IScheduledTask task, TaskExecutionOptions options)
|
||||
public void QueueScheduledTask(IScheduledTask task, TaskOptions options)
|
||||
{
|
||||
var scheduledTask = ScheduledTasks.FirstOrDefault(t => t.ScheduledTask.GetType() == task.GetType());
|
||||
|
||||
@@ -255,7 +259,7 @@ namespace Emby.Server.Implementations.ScheduledTasks
|
||||
/// </summary>
|
||||
/// <param name="task">The task.</param>
|
||||
/// <param name="options">The task options.</param>
|
||||
private void QueueScheduledTask(IScheduledTaskWorker task, TaskExecutionOptions options)
|
||||
private void QueueScheduledTask(IScheduledTaskWorker task, TaskOptions options)
|
||||
{
|
||||
var type = task.ScheduledTask.GetType();
|
||||
|
||||
@@ -269,7 +273,7 @@ namespace Emby.Server.Implementations.ScheduledTasks
|
||||
return;
|
||||
}
|
||||
|
||||
_taskQueue.Enqueue(new Tuple<Type, TaskExecutionOptions>(type, options));
|
||||
_taskQueue.Enqueue(new Tuple<Type, TaskOptions>(type, options));
|
||||
}
|
||||
}
|
||||
|
||||
@@ -297,7 +301,6 @@ namespace Emby.Server.Implementations.ScheduledTasks
|
||||
public void Dispose()
|
||||
{
|
||||
Dispose(true);
|
||||
GC.SuppressFinalize(this);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
@@ -317,7 +320,7 @@ namespace Emby.Server.Implementations.ScheduledTasks
|
||||
((ScheduledTaskWorker)task).Cancel();
|
||||
}
|
||||
|
||||
public Task Execute(IScheduledTaskWorker task, TaskExecutionOptions options)
|
||||
public Task Execute(IScheduledTaskWorker task, TaskOptions options)
|
||||
{
|
||||
return ((ScheduledTaskWorker)task).Execute(options);
|
||||
}
|
||||
@@ -362,9 +365,9 @@ namespace Emby.Server.Implementations.ScheduledTasks
|
||||
// Execute queued tasks
|
||||
lock (_taskQueue)
|
||||
{
|
||||
var list = new List<Tuple<Type, TaskExecutionOptions>>();
|
||||
var list = new List<Tuple<Type, TaskOptions>>();
|
||||
|
||||
Tuple<Type, TaskExecutionOptions> item;
|
||||
Tuple<Type, TaskOptions> item;
|
||||
while (_taskQueue.TryDequeue(out item))
|
||||
{
|
||||
if (list.All(i => i.Item1 != item.Item1))
|
||||
|
||||
@@ -81,7 +81,7 @@ namespace Emby.Server.Implementations.ScheduledTasks.Tasks
|
||||
// No biggie here. Nothing to delete
|
||||
}
|
||||
|
||||
return Task.FromResult(true);
|
||||
return Task.CompletedTask;
|
||||
}
|
||||
|
||||
|
||||
|
||||
@@ -78,7 +78,7 @@ namespace Emby.Server.Implementations.ScheduledTasks.Tasks
|
||||
|
||||
progress.Report(100);
|
||||
|
||||
return Task.FromResult(true);
|
||||
return Task.CompletedTask;
|
||||
}
|
||||
|
||||
public string Key
|
||||
|
||||
@@ -58,11 +58,9 @@ namespace Emby.Server.Implementations.ScheduledTasks.Tasks
|
||||
|
||||
progress.Report(0);
|
||||
|
||||
LogManager.ReloadLogger(ConfigurationManager.CommonConfiguration.EnableDebugLevelLogging
|
||||
return LogManager.ReloadLogger(ConfigurationManager.CommonConfiguration.EnableDebugLevelLogging
|
||||
? LogSeverity.Debug
|
||||
: LogSeverity.Info);
|
||||
|
||||
return Task.FromResult(true);
|
||||
: LogSeverity.Info, cancellationToken);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
@@ -71,7 +69,7 @@ namespace Emby.Server.Implementations.ScheduledTasks.Tasks
|
||||
/// <value>The name.</value>
|
||||
public string Name
|
||||
{
|
||||
get { return "Start new log file"; }
|
||||
get { return "Rotate log file"; }
|
||||
}
|
||||
|
||||
public string Key { get; }
|
||||
@@ -96,7 +94,7 @@ namespace Emby.Server.Implementations.ScheduledTasks.Tasks
|
||||
|
||||
public bool IsHidden
|
||||
{
|
||||
get { return true; }
|
||||
get { return false; }
|
||||
}
|
||||
|
||||
public bool IsEnabled
|
||||
|
||||
@@ -24,12 +24,9 @@ namespace Emby.Server.Implementations.ScheduledTasks
|
||||
public DayOfWeek DayOfWeek { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Gets the execution properties of this task.
|
||||
/// Gets or sets the options of this task.
|
||||
/// </summary>
|
||||
/// <value>
|
||||
/// The execution properties of this task.
|
||||
/// </value>
|
||||
public TaskExecutionOptions TaskOptions { get; set; }
|
||||
public TaskOptions TaskOptions { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Gets or sets the timer.
|
||||
@@ -100,7 +97,7 @@ namespace Emby.Server.Implementations.ScheduledTasks
|
||||
/// <summary>
|
||||
/// Occurs when [triggered].
|
||||
/// </summary>
|
||||
public event EventHandler<GenericEventArgs<TaskExecutionOptions>> Triggered;
|
||||
public event EventHandler<EventArgs> Triggered;
|
||||
|
||||
/// <summary>
|
||||
/// Called when [triggered].
|
||||
@@ -109,7 +106,7 @@ namespace Emby.Server.Implementations.ScheduledTasks
|
||||
{
|
||||
if (Triggered != null)
|
||||
{
|
||||
Triggered(this, new GenericEventArgs<TaskExecutionOptions>(TaskOptions));
|
||||
Triggered(this, EventArgs.Empty);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user