mirror of
https://github.com/jellyfin/jellyfin.git
synced 2025-05-24 02:02:29 -04:00
Merge pull request #14028 from Shadowghost/cleanup-tasks
Cleanup Tasks and Validators
This commit is contained in:
commit
b4a58ee13a
@ -5,8 +5,8 @@ using MediaBrowser.Controller.Library;
|
|||||||
using MediaBrowser.Controller.Persistence;
|
using MediaBrowser.Controller.Persistence;
|
||||||
using Microsoft.Extensions.Logging;
|
using Microsoft.Extensions.Logging;
|
||||||
|
|
||||||
namespace Emby.Server.Implementations.Library.Validators
|
namespace Emby.Server.Implementations.Library.Validators;
|
||||||
{
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Class ArtistsPostScanTask.
|
/// Class ArtistsPostScanTask.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
@ -46,4 +46,3 @@ namespace Emby.Server.Implementations.Library.Validators
|
|||||||
return new ArtistsValidator(_libraryManager, _logger, _itemRepo).Run(progress, cancellationToken);
|
return new ArtistsValidator(_libraryManager, _logger, _itemRepo).Run(progress, cancellationToken);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
@ -10,8 +10,8 @@ using MediaBrowser.Controller.Library;
|
|||||||
using MediaBrowser.Controller.Persistence;
|
using MediaBrowser.Controller.Persistence;
|
||||||
using Microsoft.Extensions.Logging;
|
using Microsoft.Extensions.Logging;
|
||||||
|
|
||||||
namespace Emby.Server.Implementations.Library.Validators
|
namespace Emby.Server.Implementations.Library.Validators;
|
||||||
{
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Class ArtistsValidator.
|
/// Class ArtistsValidator.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
@ -82,7 +82,7 @@ namespace Emby.Server.Implementations.Library.Validators
|
|||||||
|
|
||||||
var deadEntities = _libraryManager.GetItemList(new InternalItemsQuery
|
var deadEntities = _libraryManager.GetItemList(new InternalItemsQuery
|
||||||
{
|
{
|
||||||
IncludeItemTypes = new[] { BaseItemKind.MusicArtist },
|
IncludeItemTypes = [BaseItemKind.MusicArtist],
|
||||||
IsDeadArtist = true,
|
IsDeadArtist = true,
|
||||||
IsLocked = false
|
IsLocked = false
|
||||||
}).Cast<MusicArtist>().ToList();
|
}).Cast<MusicArtist>().ToList();
|
||||||
@ -94,7 +94,7 @@ namespace Emby.Server.Implementations.Library.Validators
|
|||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
|
||||||
_logger.LogInformation("Deleting dead {2} {0} {1}.", item.Id.ToString("N", CultureInfo.InvariantCulture), item.Name, item.GetType().Name);
|
_logger.LogInformation("Deleting dead {ItemType} {ItemId} {ItemName}", item.GetType().Name, item.Id.ToString("N", CultureInfo.InvariantCulture), item.Name);
|
||||||
|
|
||||||
_libraryManager.DeleteItem(
|
_libraryManager.DeleteItem(
|
||||||
item,
|
item,
|
||||||
@ -108,4 +108,3 @@ namespace Emby.Server.Implementations.Library.Validators
|
|||||||
progress.Report(100);
|
progress.Report(100);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
@ -9,12 +9,10 @@ using MediaBrowser.Controller.Collections;
|
|||||||
using MediaBrowser.Controller.Entities;
|
using MediaBrowser.Controller.Entities;
|
||||||
using MediaBrowser.Controller.Entities.Movies;
|
using MediaBrowser.Controller.Entities.Movies;
|
||||||
using MediaBrowser.Controller.Library;
|
using MediaBrowser.Controller.Library;
|
||||||
using MediaBrowser.Model.Entities;
|
|
||||||
using MediaBrowser.Model.Querying;
|
|
||||||
using Microsoft.Extensions.Logging;
|
using Microsoft.Extensions.Logging;
|
||||||
|
|
||||||
namespace Emby.Server.Implementations.Library.Validators
|
namespace Emby.Server.Implementations.Library.Validators;
|
||||||
{
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Class CollectionPostScanTask.
|
/// Class CollectionPostScanTask.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
@ -64,10 +62,10 @@ namespace Emby.Server.Implementations.Library.Validators
|
|||||||
{
|
{
|
||||||
var movies = _libraryManager.GetItemList(new InternalItemsQuery
|
var movies = _libraryManager.GetItemList(new InternalItemsQuery
|
||||||
{
|
{
|
||||||
MediaTypes = new[] { MediaType.Video },
|
MediaTypes = [MediaType.Video],
|
||||||
IncludeItemTypes = new[] { BaseItemKind.Movie },
|
IncludeItemTypes = [BaseItemKind.Movie],
|
||||||
IsVirtualItem = false,
|
IsVirtualItem = false,
|
||||||
OrderBy = new[] { (ItemSortBy.SortName, SortOrder.Ascending) },
|
OrderBy = [(ItemSortBy.SortName, SortOrder.Ascending)],
|
||||||
Parent = library,
|
Parent = library,
|
||||||
StartIndex = startIndex,
|
StartIndex = startIndex,
|
||||||
Limit = pagesize,
|
Limit = pagesize,
|
||||||
@ -109,7 +107,7 @@ namespace Emby.Server.Implementations.Library.Validators
|
|||||||
|
|
||||||
var boxSets = _libraryManager.GetItemList(new InternalItemsQuery
|
var boxSets = _libraryManager.GetItemList(new InternalItemsQuery
|
||||||
{
|
{
|
||||||
IncludeItemTypes = new[] { BaseItemKind.BoxSet },
|
IncludeItemTypes = [BaseItemKind.BoxSet],
|
||||||
CollapseBoxSetItems = false,
|
CollapseBoxSetItems = false,
|
||||||
Recursive = true
|
Recursive = true
|
||||||
});
|
});
|
||||||
@ -128,14 +126,14 @@ namespace Emby.Server.Implementations.Library.Validators
|
|||||||
{
|
{
|
||||||
Name = collectionName,
|
Name = collectionName,
|
||||||
IsLocked = true
|
IsLocked = true
|
||||||
});
|
}).ConfigureAwait(false);
|
||||||
|
|
||||||
await _collectionManager.AddToCollectionAsync(boxSet.Id, movieIds);
|
await _collectionManager.AddToCollectionAsync(boxSet.Id, movieIds).ConfigureAwait(false);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
await _collectionManager.AddToCollectionAsync(boxSet.Id, movieIds);
|
await _collectionManager.AddToCollectionAsync(boxSet.Id, movieIds).ConfigureAwait(false);
|
||||||
}
|
}
|
||||||
|
|
||||||
numComplete++;
|
numComplete++;
|
||||||
@ -154,4 +152,3 @@ namespace Emby.Server.Implementations.Library.Validators
|
|||||||
progress.Report(100);
|
progress.Report(100);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
@ -5,8 +5,8 @@ using MediaBrowser.Controller.Library;
|
|||||||
using MediaBrowser.Controller.Persistence;
|
using MediaBrowser.Controller.Persistence;
|
||||||
using Microsoft.Extensions.Logging;
|
using Microsoft.Extensions.Logging;
|
||||||
|
|
||||||
namespace Emby.Server.Implementations.Library.Validators
|
namespace Emby.Server.Implementations.Library.Validators;
|
||||||
{
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Class GenresPostScanTask.
|
/// Class GenresPostScanTask.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
@ -46,4 +46,3 @@ namespace Emby.Server.Implementations.Library.Validators
|
|||||||
return new GenresValidator(_libraryManager, _logger, _itemRepo).Run(progress, cancellationToken);
|
return new GenresValidator(_libraryManager, _logger, _itemRepo).Run(progress, cancellationToken);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
@ -8,8 +8,8 @@ using MediaBrowser.Controller.Library;
|
|||||||
using MediaBrowser.Controller.Persistence;
|
using MediaBrowser.Controller.Persistence;
|
||||||
using Microsoft.Extensions.Logging;
|
using Microsoft.Extensions.Logging;
|
||||||
|
|
||||||
namespace Emby.Server.Implementations.Library.Validators
|
namespace Emby.Server.Implementations.Library.Validators;
|
||||||
{
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Class GenresValidator.
|
/// Class GenresValidator.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
@ -101,4 +101,3 @@ namespace Emby.Server.Implementations.Library.Validators
|
|||||||
progress.Report(100);
|
progress.Report(100);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
@ -5,8 +5,8 @@ using MediaBrowser.Controller.Library;
|
|||||||
using MediaBrowser.Controller.Persistence;
|
using MediaBrowser.Controller.Persistence;
|
||||||
using Microsoft.Extensions.Logging;
|
using Microsoft.Extensions.Logging;
|
||||||
|
|
||||||
namespace Emby.Server.Implementations.Library.Validators
|
namespace Emby.Server.Implementations.Library.Validators;
|
||||||
{
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Class MusicGenresPostScanTask.
|
/// Class MusicGenresPostScanTask.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
@ -46,4 +46,3 @@ namespace Emby.Server.Implementations.Library.Validators
|
|||||||
return new MusicGenresValidator(_libraryManager, _logger, _itemRepo).Run(progress, cancellationToken);
|
return new MusicGenresValidator(_libraryManager, _logger, _itemRepo).Run(progress, cancellationToken);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
@ -5,8 +5,8 @@ using MediaBrowser.Controller.Library;
|
|||||||
using MediaBrowser.Controller.Persistence;
|
using MediaBrowser.Controller.Persistence;
|
||||||
using Microsoft.Extensions.Logging;
|
using Microsoft.Extensions.Logging;
|
||||||
|
|
||||||
namespace Emby.Server.Implementations.Library.Validators
|
namespace Emby.Server.Implementations.Library.Validators;
|
||||||
{
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Class MusicGenresValidator.
|
/// Class MusicGenresValidator.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
@ -78,4 +78,3 @@ namespace Emby.Server.Implementations.Library.Validators
|
|||||||
progress.Report(100);
|
progress.Report(100);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
@ -9,8 +9,8 @@ using MediaBrowser.Controller.Providers;
|
|||||||
using MediaBrowser.Model.IO;
|
using MediaBrowser.Model.IO;
|
||||||
using Microsoft.Extensions.Logging;
|
using Microsoft.Extensions.Logging;
|
||||||
|
|
||||||
namespace Emby.Server.Implementations.Library.Validators
|
namespace Emby.Server.Implementations.Library.Validators;
|
||||||
{
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Class PeopleValidator.
|
/// Class PeopleValidator.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
@ -55,7 +55,7 @@ namespace Emby.Server.Implementations.Library.Validators
|
|||||||
|
|
||||||
var numPeople = people.Count;
|
var numPeople = people.Count;
|
||||||
|
|
||||||
_logger.LogDebug("Will refresh {0} people", numPeople);
|
_logger.LogDebug("Will refresh {Amount} people", numPeople);
|
||||||
|
|
||||||
foreach (var person in people)
|
foreach (var person in people)
|
||||||
{
|
{
|
||||||
@ -104,11 +104,7 @@ namespace Emby.Server.Implementations.Library.Validators
|
|||||||
|
|
||||||
foreach (var item in deadEntities)
|
foreach (var item in deadEntities)
|
||||||
{
|
{
|
||||||
_logger.LogInformation(
|
_logger.LogInformation("Deleting dead {ItemType} {ItemId} {ItemName}", item.GetType().Name, item.Id.ToString("N", CultureInfo.InvariantCulture), item.Name);
|
||||||
"Deleting dead {2} {0} {1}.",
|
|
||||||
item.Id.ToString("N", CultureInfo.InvariantCulture),
|
|
||||||
item.Name,
|
|
||||||
item.GetType().Name);
|
|
||||||
|
|
||||||
_libraryManager.DeleteItem(
|
_libraryManager.DeleteItem(
|
||||||
item,
|
item,
|
||||||
@ -124,4 +120,3 @@ namespace Emby.Server.Implementations.Library.Validators
|
|||||||
_logger.LogInformation("People validation complete");
|
_logger.LogInformation("People validation complete");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
@ -5,8 +5,8 @@ using MediaBrowser.Controller.Library;
|
|||||||
using MediaBrowser.Controller.Persistence;
|
using MediaBrowser.Controller.Persistence;
|
||||||
using Microsoft.Extensions.Logging;
|
using Microsoft.Extensions.Logging;
|
||||||
|
|
||||||
namespace Emby.Server.Implementations.Library.Validators
|
namespace Emby.Server.Implementations.Library.Validators;
|
||||||
{
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Class MusicGenresPostScanTask.
|
/// Class MusicGenresPostScanTask.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
@ -47,4 +47,3 @@ namespace Emby.Server.Implementations.Library.Validators
|
|||||||
return new StudiosValidator(_libraryManager, _logger, _itemRepo).Run(progress, cancellationToken);
|
return new StudiosValidator(_libraryManager, _logger, _itemRepo).Run(progress, cancellationToken);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
@ -8,8 +8,8 @@ using MediaBrowser.Controller.Library;
|
|||||||
using MediaBrowser.Controller.Persistence;
|
using MediaBrowser.Controller.Persistence;
|
||||||
using Microsoft.Extensions.Logging;
|
using Microsoft.Extensions.Logging;
|
||||||
|
|
||||||
namespace Emby.Server.Implementations.Library.Validators
|
namespace Emby.Server.Implementations.Library.Validators;
|
||||||
{
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Class StudiosValidator.
|
/// Class StudiosValidator.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
@ -81,7 +81,7 @@ namespace Emby.Server.Implementations.Library.Validators
|
|||||||
|
|
||||||
var deadEntities = _libraryManager.GetItemList(new InternalItemsQuery
|
var deadEntities = _libraryManager.GetItemList(new InternalItemsQuery
|
||||||
{
|
{
|
||||||
IncludeItemTypes = new[] { BaseItemKind.Studio },
|
IncludeItemTypes = [BaseItemKind.Studio],
|
||||||
IsDeadStudio = true,
|
IsDeadStudio = true,
|
||||||
IsLocked = false
|
IsLocked = false
|
||||||
});
|
});
|
||||||
@ -102,4 +102,3 @@ namespace Emby.Server.Implementations.Library.Validators
|
|||||||
progress.Report(100);
|
progress.Report(100);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
@ -16,8 +16,8 @@ using MediaBrowser.Common.Extensions;
|
|||||||
using MediaBrowser.Model.Tasks;
|
using MediaBrowser.Model.Tasks;
|
||||||
using Microsoft.Extensions.Logging;
|
using Microsoft.Extensions.Logging;
|
||||||
|
|
||||||
namespace Emby.Server.Implementations.ScheduledTasks
|
namespace Emby.Server.Implementations.ScheduledTasks;
|
||||||
{
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Class ScheduledTaskWorker.
|
/// Class ScheduledTaskWorker.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
@ -676,4 +676,3 @@ namespace Emby.Server.Implementations.ScheduledTasks
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
@ -8,8 +8,8 @@ using MediaBrowser.Common.Configuration;
|
|||||||
using MediaBrowser.Model.Tasks;
|
using MediaBrowser.Model.Tasks;
|
||||||
using Microsoft.Extensions.Logging;
|
using Microsoft.Extensions.Logging;
|
||||||
|
|
||||||
namespace Emby.Server.Implementations.ScheduledTasks
|
namespace Emby.Server.Implementations.ScheduledTasks;
|
||||||
{
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Class TaskManager.
|
/// Class TaskManager.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
@ -36,7 +36,7 @@ namespace Emby.Server.Implementations.ScheduledTasks
|
|||||||
_applicationPaths = applicationPaths;
|
_applicationPaths = applicationPaths;
|
||||||
_logger = logger;
|
_logger = logger;
|
||||||
|
|
||||||
ScheduledTasks = Array.Empty<IScheduledTaskWorker>();
|
ScheduledTasks = [];
|
||||||
}
|
}
|
||||||
|
|
||||||
/// <inheritdoc />
|
/// <inheritdoc />
|
||||||
@ -81,7 +81,7 @@ namespace Emby.Server.Implementations.ScheduledTasks
|
|||||||
|
|
||||||
if (scheduledTask is null)
|
if (scheduledTask is null)
|
||||||
{
|
{
|
||||||
_logger.LogError("Unable to find scheduled task of type {0} in QueueScheduledTask.", typeof(T).Name);
|
_logger.LogError("Unable to find scheduled task of type {Type} in QueueScheduledTask.", typeof(T).Name);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
@ -116,13 +116,13 @@ namespace Emby.Server.Implementations.ScheduledTasks
|
|||||||
|
|
||||||
if (scheduledTask is null)
|
if (scheduledTask is null)
|
||||||
{
|
{
|
||||||
_logger.LogError("Unable to find scheduled task of type {0} in Execute.", typeof(T).Name);
|
_logger.LogError("Unable to find scheduled task of type {Type} in Execute.", typeof(T).Name);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
var type = scheduledTask.ScheduledTask.GetType();
|
var type = scheduledTask.ScheduledTask.GetType();
|
||||||
|
|
||||||
_logger.LogDebug("Queuing task {0}", type.Name);
|
_logger.LogDebug("Queuing task {Name}", type.Name);
|
||||||
|
|
||||||
lock (_taskQueue)
|
lock (_taskQueue)
|
||||||
{
|
{
|
||||||
@ -141,7 +141,7 @@ namespace Emby.Server.Implementations.ScheduledTasks
|
|||||||
|
|
||||||
if (scheduledTask is null)
|
if (scheduledTask is null)
|
||||||
{
|
{
|
||||||
_logger.LogError("Unable to find scheduled task of type {0} in QueueScheduledTask.", task.GetType().Name);
|
_logger.LogError("Unable to find scheduled task of type {Type} in QueueScheduledTask.", task.GetType().Name);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
@ -158,7 +158,7 @@ namespace Emby.Server.Implementations.ScheduledTasks
|
|||||||
{
|
{
|
||||||
var type = task.ScheduledTask.GetType();
|
var type = task.ScheduledTask.GetType();
|
||||||
|
|
||||||
_logger.LogDebug("Queuing task {0}", type.Name);
|
_logger.LogDebug("Queuing task {Name}", type.Name);
|
||||||
|
|
||||||
lock (_taskQueue)
|
lock (_taskQueue)
|
||||||
{
|
{
|
||||||
@ -261,4 +261,3 @@ namespace Emby.Server.Implementations.ScheduledTasks
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
@ -156,14 +156,11 @@ public partial class AudioNormalizationTask : IScheduledTask
|
|||||||
/// <inheritdoc />
|
/// <inheritdoc />
|
||||||
public IEnumerable<TaskTriggerInfo> GetDefaultTriggers()
|
public IEnumerable<TaskTriggerInfo> GetDefaultTriggers()
|
||||||
{
|
{
|
||||||
return
|
yield return new TaskTriggerInfo
|
||||||
[
|
|
||||||
new TaskTriggerInfo
|
|
||||||
{
|
{
|
||||||
Type = TaskTriggerInfoType.IntervalTrigger,
|
Type = TaskTriggerInfoType.IntervalTrigger,
|
||||||
IntervalTicks = TimeSpan.FromHours(24).Ticks
|
IntervalTicks = TimeSpan.FromHours(24).Ticks
|
||||||
}
|
};
|
||||||
];
|
|
||||||
}
|
}
|
||||||
|
|
||||||
private async Task<float?> CalculateLUFSAsync(string inputArgs, bool waitForExit, CancellationToken cancellationToken)
|
private async Task<float?> CalculateLUFSAsync(string inputArgs, bool waitForExit, CancellationToken cancellationToken)
|
||||||
@ -194,7 +191,7 @@ public partial class AudioNormalizationTask : IScheduledTask
|
|||||||
|
|
||||||
using var reader = process.StandardError;
|
using var reader = process.StandardError;
|
||||||
float? lufs = null;
|
float? lufs = null;
|
||||||
await foreach (var line in reader.ReadAllLinesAsync(cancellationToken))
|
await foreach (var line in reader.ReadAllLinesAsync(cancellationToken).ConfigureAwait(false))
|
||||||
{
|
{
|
||||||
Match match = LUFSRegex().Match(line);
|
Match match = LUFSRegex().Match(line);
|
||||||
if (match.Success)
|
if (match.Success)
|
||||||
|
@ -17,8 +17,8 @@ using MediaBrowser.Model.IO;
|
|||||||
using MediaBrowser.Model.Tasks;
|
using MediaBrowser.Model.Tasks;
|
||||||
using Microsoft.Extensions.Logging;
|
using Microsoft.Extensions.Logging;
|
||||||
|
|
||||||
namespace Emby.Server.Implementations.ScheduledTasks.Tasks
|
namespace Emby.Server.Implementations.ScheduledTasks.Tasks;
|
||||||
{
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Class ChapterImagesTask.
|
/// Class ChapterImagesTask.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
@ -71,15 +71,12 @@ namespace Emby.Server.Implementations.ScheduledTasks.Tasks
|
|||||||
/// <inheritdoc />
|
/// <inheritdoc />
|
||||||
public IEnumerable<TaskTriggerInfo> GetDefaultTriggers()
|
public IEnumerable<TaskTriggerInfo> GetDefaultTriggers()
|
||||||
{
|
{
|
||||||
return
|
yield return new TaskTriggerInfo
|
||||||
[
|
|
||||||
new TaskTriggerInfo
|
|
||||||
{
|
{
|
||||||
Type = TaskTriggerInfoType.DailyTrigger,
|
Type = TaskTriggerInfoType.DailyTrigger,
|
||||||
TimeOfDayTicks = TimeSpan.FromHours(2).Ticks,
|
TimeOfDayTicks = TimeSpan.FromHours(2).Ticks,
|
||||||
MaxRuntimeTicks = TimeSpan.FromHours(4).Ticks
|
MaxRuntimeTicks = TimeSpan.FromHours(4).Ticks
|
||||||
}
|
};
|
||||||
];
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/// <inheritdoc />
|
/// <inheritdoc />
|
||||||
@ -169,4 +166,3 @@ namespace Emby.Server.Implementations.ScheduledTasks.Tasks
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
@ -7,8 +7,8 @@ using MediaBrowser.Model.Activity;
|
|||||||
using MediaBrowser.Model.Globalization;
|
using MediaBrowser.Model.Globalization;
|
||||||
using MediaBrowser.Model.Tasks;
|
using MediaBrowser.Model.Tasks;
|
||||||
|
|
||||||
namespace Emby.Server.Implementations.ScheduledTasks.Tasks
|
namespace Emby.Server.Implementations.ScheduledTasks.Tasks;
|
||||||
{
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Deletes old activity log entries.
|
/// Deletes old activity log entries.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
@ -74,4 +74,3 @@ namespace Emby.Server.Implementations.ScheduledTasks.Tasks
|
|||||||
return [];
|
return [];
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
@ -27,7 +27,6 @@ public class CleanupCollectionAndPlaylistPathsTask : IScheduledTask
|
|||||||
private readonly IPlaylistManager _playlistManager;
|
private readonly IPlaylistManager _playlistManager;
|
||||||
private readonly ILogger<CleanupCollectionAndPlaylistPathsTask> _logger;
|
private readonly ILogger<CleanupCollectionAndPlaylistPathsTask> _logger;
|
||||||
private readonly IProviderManager _providerManager;
|
private readonly IProviderManager _providerManager;
|
||||||
private readonly IFileSystem _fileSystem;
|
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Initializes a new instance of the <see cref="CleanupCollectionAndPlaylistPathsTask"/> class.
|
/// Initializes a new instance of the <see cref="CleanupCollectionAndPlaylistPathsTask"/> class.
|
||||||
@ -37,21 +36,18 @@ public class CleanupCollectionAndPlaylistPathsTask : IScheduledTask
|
|||||||
/// <param name="playlistManager">Instance of the <see cref="IPlaylistManager"/> interface.</param>
|
/// <param name="playlistManager">Instance of the <see cref="IPlaylistManager"/> interface.</param>
|
||||||
/// <param name="logger">Instance of the <see cref="ILogger"/> interface.</param>
|
/// <param name="logger">Instance of the <see cref="ILogger"/> interface.</param>
|
||||||
/// <param name="providerManager">Instance of the <see cref="IProviderManager"/> interface.</param>
|
/// <param name="providerManager">Instance of the <see cref="IProviderManager"/> interface.</param>
|
||||||
/// <param name="fileSystem">Instance of the <see cref="IFileSystem"/> interface.</param>
|
|
||||||
public CleanupCollectionAndPlaylistPathsTask(
|
public CleanupCollectionAndPlaylistPathsTask(
|
||||||
ILocalizationManager localization,
|
ILocalizationManager localization,
|
||||||
ICollectionManager collectionManager,
|
ICollectionManager collectionManager,
|
||||||
IPlaylistManager playlistManager,
|
IPlaylistManager playlistManager,
|
||||||
ILogger<CleanupCollectionAndPlaylistPathsTask> logger,
|
ILogger<CleanupCollectionAndPlaylistPathsTask> logger,
|
||||||
IProviderManager providerManager,
|
IProviderManager providerManager)
|
||||||
IFileSystem fileSystem)
|
|
||||||
{
|
{
|
||||||
_localization = localization;
|
_localization = localization;
|
||||||
_collectionManager = collectionManager;
|
_collectionManager = collectionManager;
|
||||||
_playlistManager = playlistManager;
|
_playlistManager = playlistManager;
|
||||||
_logger = logger;
|
_logger = logger;
|
||||||
_providerManager = providerManager;
|
_providerManager = providerManager;
|
||||||
_fileSystem = fileSystem;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/// <inheritdoc />
|
/// <inheritdoc />
|
||||||
@ -135,6 +131,9 @@ public class CleanupCollectionAndPlaylistPathsTask : IScheduledTask
|
|||||||
/// <inheritdoc />
|
/// <inheritdoc />
|
||||||
public IEnumerable<TaskTriggerInfo> GetDefaultTriggers()
|
public IEnumerable<TaskTriggerInfo> GetDefaultTriggers()
|
||||||
{
|
{
|
||||||
return [new TaskTriggerInfo() { Type = TaskTriggerInfoType.StartupTrigger }];
|
yield return new TaskTriggerInfo
|
||||||
|
{
|
||||||
|
Type = TaskTriggerInfoType.StartupTrigger,
|
||||||
|
};
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -11,8 +11,8 @@ using MediaBrowser.Model.IO;
|
|||||||
using MediaBrowser.Model.Tasks;
|
using MediaBrowser.Model.Tasks;
|
||||||
using Microsoft.Extensions.Logging;
|
using Microsoft.Extensions.Logging;
|
||||||
|
|
||||||
namespace Emby.Server.Implementations.ScheduledTasks.Tasks
|
namespace Emby.Server.Implementations.ScheduledTasks.Tasks;
|
||||||
{
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Deletes old cache files.
|
/// Deletes old cache files.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
@ -70,11 +70,11 @@ namespace Emby.Server.Implementations.ScheduledTasks.Tasks
|
|||||||
/// <inheritdoc />
|
/// <inheritdoc />
|
||||||
public IEnumerable<TaskTriggerInfo> GetDefaultTriggers()
|
public IEnumerable<TaskTriggerInfo> GetDefaultTriggers()
|
||||||
{
|
{
|
||||||
return
|
yield return new TaskTriggerInfo
|
||||||
[
|
{
|
||||||
// Every so often
|
Type = TaskTriggerInfoType.IntervalTrigger,
|
||||||
new TaskTriggerInfo { Type = TaskTriggerInfoType.IntervalTrigger, IntervalTicks = TimeSpan.FromHours(24).Ticks }
|
IntervalTicks = TimeSpan.FromHours(24).Ticks
|
||||||
];
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
/// <inheritdoc />
|
/// <inheritdoc />
|
||||||
@ -141,4 +141,3 @@ namespace Emby.Server.Implementations.ScheduledTasks.Tasks
|
|||||||
progress.Report(100);
|
progress.Report(100);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
@ -9,8 +9,8 @@ using MediaBrowser.Model.Globalization;
|
|||||||
using MediaBrowser.Model.IO;
|
using MediaBrowser.Model.IO;
|
||||||
using MediaBrowser.Model.Tasks;
|
using MediaBrowser.Model.Tasks;
|
||||||
|
|
||||||
namespace Emby.Server.Implementations.ScheduledTasks.Tasks
|
namespace Emby.Server.Implementations.ScheduledTasks.Tasks;
|
||||||
{
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Deletes old log files.
|
/// Deletes old log files.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
@ -60,10 +60,11 @@ namespace Emby.Server.Implementations.ScheduledTasks.Tasks
|
|||||||
/// <inheritdoc />
|
/// <inheritdoc />
|
||||||
public IEnumerable<TaskTriggerInfo> GetDefaultTriggers()
|
public IEnumerable<TaskTriggerInfo> GetDefaultTriggers()
|
||||||
{
|
{
|
||||||
return
|
yield return new TaskTriggerInfo
|
||||||
[
|
{
|
||||||
new TaskTriggerInfo { Type = TaskTriggerInfoType.IntervalTrigger, IntervalTicks = TimeSpan.FromHours(24).Ticks }
|
Type = TaskTriggerInfoType.IntervalTrigger,
|
||||||
];
|
IntervalTicks = TimeSpan.FromHours(24).Ticks
|
||||||
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
/// <inheritdoc />
|
/// <inheritdoc />
|
||||||
@ -98,4 +99,3 @@ namespace Emby.Server.Implementations.ScheduledTasks.Tasks
|
|||||||
return Task.CompletedTask;
|
return Task.CompletedTask;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
@ -10,8 +10,8 @@ using MediaBrowser.Model.IO;
|
|||||||
using MediaBrowser.Model.Tasks;
|
using MediaBrowser.Model.Tasks;
|
||||||
using Microsoft.Extensions.Logging;
|
using Microsoft.Extensions.Logging;
|
||||||
|
|
||||||
namespace Emby.Server.Implementations.ScheduledTasks.Tasks
|
namespace Emby.Server.Implementations.ScheduledTasks.Tasks;
|
||||||
{
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Deletes all transcoding temp files.
|
/// Deletes all transcoding temp files.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
@ -65,18 +65,16 @@ namespace Emby.Server.Implementations.ScheduledTasks.Tasks
|
|||||||
/// <inheritdoc />
|
/// <inheritdoc />
|
||||||
public IEnumerable<TaskTriggerInfo> GetDefaultTriggers()
|
public IEnumerable<TaskTriggerInfo> GetDefaultTriggers()
|
||||||
{
|
{
|
||||||
return
|
yield return new TaskTriggerInfo
|
||||||
[
|
|
||||||
new TaskTriggerInfo
|
|
||||||
{
|
{
|
||||||
Type = TaskTriggerInfoType.StartupTrigger
|
Type = TaskTriggerInfoType.StartupTrigger
|
||||||
},
|
};
|
||||||
new TaskTriggerInfo
|
|
||||||
|
yield return new TaskTriggerInfo
|
||||||
{
|
{
|
||||||
Type = TaskTriggerInfoType.IntervalTrigger,
|
Type = TaskTriggerInfoType.IntervalTrigger,
|
||||||
IntervalTicks = TimeSpan.FromHours(24).Ticks
|
IntervalTicks = TimeSpan.FromHours(24).Ticks
|
||||||
}
|
};
|
||||||
];
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/// <inheritdoc />
|
/// <inheritdoc />
|
||||||
@ -124,4 +122,3 @@ namespace Emby.Server.Implementations.ScheduledTasks.Tasks
|
|||||||
progress.Report(100);
|
progress.Report(100);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
@ -62,11 +62,11 @@ public class MediaSegmentExtractionTask : IScheduledTask
|
|||||||
|
|
||||||
var query = new InternalItemsQuery
|
var query = new InternalItemsQuery
|
||||||
{
|
{
|
||||||
MediaTypes = new[] { MediaType.Video, MediaType.Audio },
|
MediaTypes = [MediaType.Video, MediaType.Audio],
|
||||||
IsVirtualItem = false,
|
IsVirtualItem = false,
|
||||||
IncludeItemTypes = _itemTypes,
|
IncludeItemTypes = _itemTypes,
|
||||||
DtoOptions = new DtoOptions(true),
|
DtoOptions = new DtoOptions(true),
|
||||||
SourceTypes = new[] { SourceType.Library },
|
SourceTypes = [SourceType.Library],
|
||||||
Recursive = true,
|
Recursive = true,
|
||||||
Limit = pagesize
|
Limit = pagesize
|
||||||
};
|
};
|
||||||
|
@ -5,11 +5,10 @@ using System.Threading.Tasks;
|
|||||||
using Jellyfin.Database.Implementations;
|
using Jellyfin.Database.Implementations;
|
||||||
using MediaBrowser.Model.Globalization;
|
using MediaBrowser.Model.Globalization;
|
||||||
using MediaBrowser.Model.Tasks;
|
using MediaBrowser.Model.Tasks;
|
||||||
using Microsoft.EntityFrameworkCore;
|
|
||||||
using Microsoft.Extensions.Logging;
|
using Microsoft.Extensions.Logging;
|
||||||
|
|
||||||
namespace Emby.Server.Implementations.ScheduledTasks.Tasks
|
namespace Emby.Server.Implementations.ScheduledTasks.Tasks;
|
||||||
{
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Optimizes Jellyfin's database by issuing a VACUUM command.
|
/// Optimizes Jellyfin's database by issuing a VACUUM command.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
@ -17,7 +16,6 @@ namespace Emby.Server.Implementations.ScheduledTasks.Tasks
|
|||||||
{
|
{
|
||||||
private readonly ILogger<OptimizeDatabaseTask> _logger;
|
private readonly ILogger<OptimizeDatabaseTask> _logger;
|
||||||
private readonly ILocalizationManager _localization;
|
private readonly ILocalizationManager _localization;
|
||||||
private readonly IDbContextFactory<JellyfinDbContext> _provider;
|
|
||||||
private readonly IJellyfinDatabaseProvider _jellyfinDatabaseProvider;
|
private readonly IJellyfinDatabaseProvider _jellyfinDatabaseProvider;
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
@ -25,17 +23,14 @@ namespace Emby.Server.Implementations.ScheduledTasks.Tasks
|
|||||||
/// </summary>
|
/// </summary>
|
||||||
/// <param name="logger">Instance of the <see cref="ILogger"/> interface.</param>
|
/// <param name="logger">Instance of the <see cref="ILogger"/> interface.</param>
|
||||||
/// <param name="localization">Instance of the <see cref="ILocalizationManager"/> interface.</param>
|
/// <param name="localization">Instance of the <see cref="ILocalizationManager"/> interface.</param>
|
||||||
/// <param name="provider">Instance of the <see cref="IDbContextFactory{JellyfinDbContext}"/> interface.</param>
|
|
||||||
/// <param name="jellyfinDatabaseProvider">Instance of the JellyfinDatabaseProvider that can be used for provider specific operations.</param>
|
/// <param name="jellyfinDatabaseProvider">Instance of the JellyfinDatabaseProvider that can be used for provider specific operations.</param>
|
||||||
public OptimizeDatabaseTask(
|
public OptimizeDatabaseTask(
|
||||||
ILogger<OptimizeDatabaseTask> logger,
|
ILogger<OptimizeDatabaseTask> logger,
|
||||||
ILocalizationManager localization,
|
ILocalizationManager localization,
|
||||||
IDbContextFactory<JellyfinDbContext> provider,
|
|
||||||
IJellyfinDatabaseProvider jellyfinDatabaseProvider)
|
IJellyfinDatabaseProvider jellyfinDatabaseProvider)
|
||||||
{
|
{
|
||||||
_logger = logger;
|
_logger = logger;
|
||||||
_localization = localization;
|
_localization = localization;
|
||||||
_provider = provider;
|
|
||||||
_jellyfinDatabaseProvider = jellyfinDatabaseProvider;
|
_jellyfinDatabaseProvider = jellyfinDatabaseProvider;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -63,11 +58,11 @@ namespace Emby.Server.Implementations.ScheduledTasks.Tasks
|
|||||||
/// <inheritdoc />
|
/// <inheritdoc />
|
||||||
public IEnumerable<TaskTriggerInfo> GetDefaultTriggers()
|
public IEnumerable<TaskTriggerInfo> GetDefaultTriggers()
|
||||||
{
|
{
|
||||||
return
|
yield return new TaskTriggerInfo
|
||||||
[
|
{
|
||||||
// Every so often
|
Type = TaskTriggerInfoType.IntervalTrigger,
|
||||||
new TaskTriggerInfo { Type = TaskTriggerInfoType.IntervalTrigger, IntervalTicks = TimeSpan.FromHours(24).Ticks }
|
IntervalTicks = TimeSpan.FromHours(24).Ticks
|
||||||
];
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
/// <inheritdoc />
|
/// <inheritdoc />
|
||||||
@ -85,4 +80,3 @@ namespace Emby.Server.Implementations.ScheduledTasks.Tasks
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
@ -6,8 +6,8 @@ using MediaBrowser.Controller.Library;
|
|||||||
using MediaBrowser.Model.Globalization;
|
using MediaBrowser.Model.Globalization;
|
||||||
using MediaBrowser.Model.Tasks;
|
using MediaBrowser.Model.Tasks;
|
||||||
|
|
||||||
namespace Emby.Server.Implementations.ScheduledTasks.Tasks
|
namespace Emby.Server.Implementations.ScheduledTasks.Tasks;
|
||||||
{
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Class PeopleValidationTask.
|
/// Class PeopleValidationTask.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
@ -54,13 +54,10 @@ namespace Emby.Server.Implementations.ScheduledTasks.Tasks
|
|||||||
/// <returns>An <see cref="IEnumerable{TaskTriggerInfo}"/> containing the default trigger infos for this task.</returns>
|
/// <returns>An <see cref="IEnumerable{TaskTriggerInfo}"/> containing the default trigger infos for this task.</returns>
|
||||||
public IEnumerable<TaskTriggerInfo> GetDefaultTriggers()
|
public IEnumerable<TaskTriggerInfo> GetDefaultTriggers()
|
||||||
{
|
{
|
||||||
return new[]
|
yield return new TaskTriggerInfo
|
||||||
{
|
|
||||||
new TaskTriggerInfo
|
|
||||||
{
|
{
|
||||||
Type = TaskTriggerInfoType.IntervalTrigger,
|
Type = TaskTriggerInfoType.IntervalTrigger,
|
||||||
IntervalTicks = TimeSpan.FromDays(7).Ticks
|
IntervalTicks = TimeSpan.FromDays(7).Ticks
|
||||||
}
|
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -70,4 +67,3 @@ namespace Emby.Server.Implementations.ScheduledTasks.Tasks
|
|||||||
return _libraryManager.ValidatePeopleAsync(progress, cancellationToken);
|
return _libraryManager.ValidatePeopleAsync(progress, cancellationToken);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
@ -10,8 +10,8 @@ using MediaBrowser.Model.Globalization;
|
|||||||
using MediaBrowser.Model.Tasks;
|
using MediaBrowser.Model.Tasks;
|
||||||
using Microsoft.Extensions.Logging;
|
using Microsoft.Extensions.Logging;
|
||||||
|
|
||||||
namespace Emby.Server.Implementations.ScheduledTasks.Tasks
|
namespace Emby.Server.Implementations.ScheduledTasks.Tasks;
|
||||||
{
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Plugin Update Task.
|
/// Plugin Update Task.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
@ -59,11 +59,16 @@ namespace Emby.Server.Implementations.ScheduledTasks.Tasks
|
|||||||
/// <inheritdoc />
|
/// <inheritdoc />
|
||||||
public IEnumerable<TaskTriggerInfo> GetDefaultTriggers()
|
public IEnumerable<TaskTriggerInfo> GetDefaultTriggers()
|
||||||
{
|
{
|
||||||
// At startup
|
yield return new TaskTriggerInfo
|
||||||
yield return new TaskTriggerInfo { Type = TaskTriggerInfoType.StartupTrigger };
|
{
|
||||||
|
Type = TaskTriggerInfoType.StartupTrigger
|
||||||
|
};
|
||||||
|
|
||||||
// Every so often
|
yield return new TaskTriggerInfo
|
||||||
yield return new TaskTriggerInfo { Type = TaskTriggerInfoType.IntervalTrigger, IntervalTicks = TimeSpan.FromHours(24).Ticks };
|
{
|
||||||
|
Type = TaskTriggerInfoType.IntervalTrigger,
|
||||||
|
IntervalTicks = TimeSpan.FromHours(24).Ticks
|
||||||
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
/// <inheritdoc />
|
/// <inheritdoc />
|
||||||
@ -96,15 +101,15 @@ namespace Emby.Server.Implementations.ScheduledTasks.Tasks
|
|||||||
}
|
}
|
||||||
catch (HttpRequestException ex)
|
catch (HttpRequestException ex)
|
||||||
{
|
{
|
||||||
_logger.LogError(ex, "Error downloading {0}", package.Name);
|
_logger.LogError(ex, "Error downloading {Name}", package.Name);
|
||||||
}
|
}
|
||||||
catch (IOException ex)
|
catch (IOException ex)
|
||||||
{
|
{
|
||||||
_logger.LogError(ex, "Error updating {0}", package.Name);
|
_logger.LogError(ex, "Error updating {Name}", package.Name);
|
||||||
}
|
}
|
||||||
catch (InvalidDataException ex)
|
catch (InvalidDataException ex)
|
||||||
{
|
{
|
||||||
_logger.LogError(ex, "Error updating {0}", package.Name);
|
_logger.LogError(ex, "Error updating {Name}", package.Name);
|
||||||
}
|
}
|
||||||
|
|
||||||
// Update progress
|
// Update progress
|
||||||
@ -117,4 +122,3 @@ namespace Emby.Server.Implementations.ScheduledTasks.Tasks
|
|||||||
progress.Report(100);
|
progress.Report(100);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
@ -7,8 +7,8 @@ using MediaBrowser.Controller.Library;
|
|||||||
using MediaBrowser.Model.Globalization;
|
using MediaBrowser.Model.Globalization;
|
||||||
using MediaBrowser.Model.Tasks;
|
using MediaBrowser.Model.Tasks;
|
||||||
|
|
||||||
namespace Emby.Server.Implementations.ScheduledTasks.Tasks
|
namespace Emby.Server.Implementations.ScheduledTasks.Tasks;
|
||||||
{
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Class RefreshMediaLibraryTask.
|
/// Class RefreshMediaLibraryTask.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
@ -63,4 +63,3 @@ namespace Emby.Server.Implementations.ScheduledTasks.Tasks
|
|||||||
return ((LibraryManager)_libraryManager).ValidateMediaLibraryInternal(progress, cancellationToken);
|
return ((LibraryManager)_libraryManager).ValidateMediaLibraryInternal(progress, cancellationToken);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
@ -3,8 +3,8 @@ using System.Threading;
|
|||||||
using MediaBrowser.Model.Tasks;
|
using MediaBrowser.Model.Tasks;
|
||||||
using Microsoft.Extensions.Logging;
|
using Microsoft.Extensions.Logging;
|
||||||
|
|
||||||
namespace Emby.Server.Implementations.ScheduledTasks.Triggers
|
namespace Emby.Server.Implementations.ScheduledTasks.Triggers;
|
||||||
{
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Represents a task trigger that fires everyday.
|
/// Represents a task trigger that fires everyday.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
@ -12,16 +12,16 @@ namespace Emby.Server.Implementations.ScheduledTasks.Triggers
|
|||||||
{
|
{
|
||||||
private readonly TimeSpan _timeOfDay;
|
private readonly TimeSpan _timeOfDay;
|
||||||
private Timer? _timer;
|
private Timer? _timer;
|
||||||
private bool _disposed = false;
|
private bool _disposed;
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Initializes a new instance of the <see cref="DailyTrigger"/> class.
|
/// Initializes a new instance of the <see cref="DailyTrigger"/> class.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
/// <param name="timeofDay">The time of day to trigger the task to run.</param>
|
/// <param name="timeOfDay">The time of day to trigger the task to run.</param>
|
||||||
/// <param name="taskOptions">The options of this task.</param>
|
/// <param name="taskOptions">The options of this task.</param>
|
||||||
public DailyTrigger(TimeSpan timeofDay, TaskOptions taskOptions)
|
public DailyTrigger(TimeSpan timeOfDay, TaskOptions taskOptions)
|
||||||
{
|
{
|
||||||
_timeOfDay = timeofDay;
|
_timeOfDay = timeOfDay;
|
||||||
TaskOptions = taskOptions;
|
TaskOptions = taskOptions;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -84,4 +84,3 @@ namespace Emby.Server.Implementations.ScheduledTasks.Triggers
|
|||||||
_disposed = true;
|
_disposed = true;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
@ -4,8 +4,8 @@ using System.Threading;
|
|||||||
using MediaBrowser.Model.Tasks;
|
using MediaBrowser.Model.Tasks;
|
||||||
using Microsoft.Extensions.Logging;
|
using Microsoft.Extensions.Logging;
|
||||||
|
|
||||||
namespace Emby.Server.Implementations.ScheduledTasks.Triggers
|
namespace Emby.Server.Implementations.ScheduledTasks.Triggers;
|
||||||
{
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Represents a task trigger that runs repeatedly on an interval.
|
/// Represents a task trigger that runs repeatedly on an interval.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
@ -14,7 +14,7 @@ namespace Emby.Server.Implementations.ScheduledTasks.Triggers
|
|||||||
private readonly TimeSpan _interval;
|
private readonly TimeSpan _interval;
|
||||||
private DateTime _lastStartDate;
|
private DateTime _lastStartDate;
|
||||||
private Timer? _timer;
|
private Timer? _timer;
|
||||||
private bool _disposed = false;
|
private bool _disposed;
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Initializes a new instance of the <see cref="IntervalTrigger"/> class.
|
/// Initializes a new instance of the <see cref="IntervalTrigger"/> class.
|
||||||
@ -104,4 +104,3 @@ namespace Emby.Server.Implementations.ScheduledTasks.Triggers
|
|||||||
_disposed = true;
|
_disposed = true;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
@ -3,8 +3,8 @@ using System.Threading.Tasks;
|
|||||||
using MediaBrowser.Model.Tasks;
|
using MediaBrowser.Model.Tasks;
|
||||||
using Microsoft.Extensions.Logging;
|
using Microsoft.Extensions.Logging;
|
||||||
|
|
||||||
namespace Emby.Server.Implementations.ScheduledTasks.Triggers
|
namespace Emby.Server.Implementations.ScheduledTasks.Triggers;
|
||||||
{
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Class StartupTaskTrigger.
|
/// Class StartupTaskTrigger.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
@ -51,4 +51,3 @@ namespace Emby.Server.Implementations.ScheduledTasks.Triggers
|
|||||||
Triggered?.Invoke(this, EventArgs.Empty);
|
Triggered?.Invoke(this, EventArgs.Empty);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
@ -3,8 +3,8 @@ using System.Threading;
|
|||||||
using MediaBrowser.Model.Tasks;
|
using MediaBrowser.Model.Tasks;
|
||||||
using Microsoft.Extensions.Logging;
|
using Microsoft.Extensions.Logging;
|
||||||
|
|
||||||
namespace Emby.Server.Implementations.ScheduledTasks.Triggers
|
namespace Emby.Server.Implementations.ScheduledTasks.Triggers;
|
||||||
{
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Represents a task trigger that fires on a weekly basis.
|
/// Represents a task trigger that fires on a weekly basis.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
@ -18,12 +18,12 @@ namespace Emby.Server.Implementations.ScheduledTasks.Triggers
|
|||||||
/// <summary>
|
/// <summary>
|
||||||
/// Initializes a new instance of the <see cref="WeeklyTrigger"/> class.
|
/// Initializes a new instance of the <see cref="WeeklyTrigger"/> class.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
/// <param name="timeofDay">The time of day to trigger the task to run.</param>
|
/// <param name="timeOfDay">The time of day to trigger the task to run.</param>
|
||||||
/// <param name="dayOfWeek">The day of week.</param>
|
/// <param name="dayOfWeek">The day of week.</param>
|
||||||
/// <param name="taskOptions">The options of this task.</param>
|
/// <param name="taskOptions">The options of this task.</param>
|
||||||
public WeeklyTrigger(TimeSpan timeofDay, DayOfWeek dayOfWeek, TaskOptions taskOptions)
|
public WeeklyTrigger(TimeSpan timeOfDay, DayOfWeek dayOfWeek, TaskOptions taskOptions)
|
||||||
{
|
{
|
||||||
_timeOfDay = timeofDay;
|
_timeOfDay = timeOfDay;
|
||||||
_dayOfWeek = dayOfWeek;
|
_dayOfWeek = dayOfWeek;
|
||||||
TaskOptions = taskOptions;
|
TaskOptions = taskOptions;
|
||||||
}
|
}
|
||||||
@ -107,4 +107,3 @@ namespace Emby.Server.Implementations.ScheduledTasks.Triggers
|
|||||||
_disposed = true;
|
_disposed = true;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user