Cleanup tasks

This commit is contained in:
Shadowghost
2024-09-04 17:38:10 +02:00
parent 737a1b8a37
commit 08ed0a9a5d
23 changed files with 191 additions and 258 deletions

View File

@@ -36,13 +36,13 @@ namespace Emby.Server.Implementations.ScheduledTasks.Tasks
/// <summary>
/// Initializes a new instance of the <see cref="ChapterImagesTask" /> class.
/// </summary>
/// <param name="logger">The logger.</param>.
/// <param name="libraryManager">The library manager.</param>.
/// <param name="itemRepo">The item repository.</param>
/// <param name="appPaths">The application paths.</param>
/// <param name="encodingManager">The encoding manager.</param>
/// <param name="fileSystem">The filesystem.</param>
/// <param name="localization">The localization manager.</param>
/// <param name="logger">Instance of the <see cref="ILogger"/> interface.</param>
/// <param name="libraryManager">Instance of the <see cref="ILibraryManager"/> interface.</param>
/// <param name="itemRepo">Instance of the <see cref="IItemRepository"/> interface.</param>
/// <param name="appPaths">Instance of the <see cref="IApplicationPaths"/> interface.</param>
/// <param name="encodingManager">Instance of the <see cref="IEncodingManager"/> interface.</param>
/// <param name="fileSystem">Instance of the <see cref="IFileSystem"/> interface.</param>
/// <param name="localization">Instance of the <see cref="ILocalizationManager"/> interface.</param>
public ChapterImagesTask(
ILogger<ChapterImagesTask> logger,
ILibraryManager libraryManager,
@@ -76,15 +76,15 @@ namespace Emby.Server.Implementations.ScheduledTasks.Tasks
/// <inheritdoc />
public IEnumerable<TaskTriggerInfo> GetDefaultTriggers()
{
return new[]
{
return
[
new TaskTriggerInfo
{
Type = TaskTriggerInfo.TriggerDaily,
TimeOfDayTicks = TimeSpan.FromHours(2).Ticks,
MaxRuntimeTicks = TimeSpan.FromHours(4).Ticks
}
};
];
}
/// <inheritdoc />
@@ -92,18 +92,18 @@ namespace Emby.Server.Implementations.ScheduledTasks.Tasks
{
var videos = _libraryManager.GetItemList(new InternalItemsQuery
{
MediaTypes = new[] { MediaType.Video },
MediaTypes = [MediaType.Video],
IsFolder = false,
Recursive = true,
DtoOptions = new DtoOptions(false)
{
EnableImages = false
},
SourceTypes = new SourceType[] { SourceType.Library },
SourceTypes = [SourceType.Library],
IsVirtualItem = false
})
.OfType<Video>()
.ToList();
.OfType<Video>()
.ToList();
var numComplete = 0;