Skip to content

Commit

Permalink
fix: clear all caches
Browse files Browse the repository at this point in the history
- clear all the caches when a library scan is complete, not just the manager's
  cache. (we have three now btw.)
  • Loading branch information
revam committed Mar 29, 2024
1 parent b133e56 commit 846faa2
Showing 1 changed file with 13 additions and 4 deletions.
17 changes: 13 additions & 4 deletions Shokofin/Tasks/PostScanTask.cs
Original file line number Diff line number Diff line change
@@ -1,11 +1,12 @@
using System;
using System.Threading;
using System.Threading.Tasks;
using MediaBrowser.Common.Progress;
using MediaBrowser.Controller.Library;
using Shokofin.API;
using Shokofin.Collections;
using Shokofin.MergeVersions;
using System;
using System.Threading;
using System.Threading.Tasks;
using Shokofin.Resolvers;

#nullable enable
namespace Shokofin.Tasks;
Expand All @@ -14,13 +15,19 @@ public class PostScanTask : ILibraryPostScanTask
{
private readonly ShokoAPIManager ApiManager;

private readonly ShokoAPIClient ApiClient;

private readonly ShokoResolveManager ResolveManager;

private readonly MergeVersionsManager VersionsManager;

private readonly CollectionManager CollectionManager;

public PostScanTask(ShokoAPIManager apiManager, MergeVersionsManager versionsManager, CollectionManager collectionManager)
public PostScanTask(ShokoAPIManager apiManager, ShokoAPIClient apiClient, ShokoResolveManager resolveManager, MergeVersionsManager versionsManager, CollectionManager collectionManager)
{
ApiManager = apiManager;
ApiClient = apiClient;
ResolveManager = resolveManager;
VersionsManager = versionsManager;
CollectionManager = collectionManager;
}
Expand Down Expand Up @@ -49,6 +56,8 @@ public async Task Run(IProgress<double> progress, CancellationToken token)
}

// Clear the cache now, since we don't need it anymore.
ApiClient.Clear();
ApiManager.Clear();
ResolveManager.Clear();
}
}

0 comments on commit 846faa2

Please sign in to comment.