diff options
| author | JPVenson <JPVenson@users.noreply.github.com> | 2023-02-01 22:42:10 +0100 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2023-02-01 22:42:10 +0100 |
| commit | 341658b55259084635b52983245800deff8d561d (patch) | |
| tree | 71bf441dc73777b178f5aa71cd48a43dab507c8d /Emby.Server.Implementations/ScheduledTasks/Tasks/CleanupCollectionPathsTask.cs | |
| parent | 6b8d1695297c28098924c5da18da133083ca9c92 (diff) | |
Update CleanupCollectionPathsTask.cs
Removed code smell and switched to non creation for non existing collection folder
Diffstat (limited to 'Emby.Server.Implementations/ScheduledTasks/Tasks/CleanupCollectionPathsTask.cs')
| -rw-r--r-- | Emby.Server.Implementations/ScheduledTasks/Tasks/CleanupCollectionPathsTask.cs | 9 |
1 files changed, 4 insertions, 5 deletions
diff --git a/Emby.Server.Implementations/ScheduledTasks/Tasks/CleanupCollectionPathsTask.cs b/Emby.Server.Implementations/ScheduledTasks/Tasks/CleanupCollectionPathsTask.cs index 8e9270a12..7519af5b0 100644 --- a/Emby.Server.Implementations/ScheduledTasks/Tasks/CleanupCollectionPathsTask.cs +++ b/Emby.Server.Implementations/ScheduledTasks/Tasks/CleanupCollectionPathsTask.cs @@ -65,16 +65,16 @@ public class CleanupCollectionPathsTask : IScheduledTask /// <inheritdoc /> public async Task ExecuteAsync(IProgress<double> progress, CancellationToken cancellationToken) { - var collectionsFolder = await _collectionManager.GetCollectionsFolder(true).ConfigureAwait(false); + var collectionsFolder = await _collectionManager.GetCollectionsFolder(false).ConfigureAwait(false); if (collectionsFolder is null) { _logger.LogInformation("There is no collection folder to be found."); return; } - var collections = collectionsFolder.Children.OfType<BoxSet>() - .ToArray(); + var collections = collectionsFolder.Children.OfType<BoxSet>().ToArray(); _logger.LogTrace("Found {CollectionLength} Boxsets.", collections.Length); + for (var index = 0; index < collections.Length; index++) { var collection = collections[index]; @@ -84,7 +84,7 @@ public class CleanupCollectionPathsTask : IScheduledTask { if (!File.Exists(collectionLinkedChild.Path)) { - _logger.LogInformation("Item in boxset {0} cannot be found at {1}.", collection.Name, collectionLinkedChild.Path); + _logger.LogInformation("Item in boxset {CollectionName} cannot be found at {ItemPath}.", collection.Name, collectionLinkedChild.Path); itemsToRemove.Add(collectionLinkedChild); } } @@ -113,6 +113,5 @@ public class CleanupCollectionPathsTask : IScheduledTask public IEnumerable<TaskTriggerInfo> GetDefaultTriggers() { return new[] { new TaskTriggerInfo() { Type = TaskTriggerInfo.TriggerStartup } }; - // return Enumerable.Empty<TaskTriggerInfo>(); } } |
