From 846faa20668efa2ce0e794303ac134cc8708e092 Mon Sep 17 00:00:00 2001 From: Mikal Stordal Date: Fri, 29 Mar 2024 06:37:22 +0100 Subject: [PATCH] fix: clear all caches - clear all the caches when a library scan is complete, not just the manager's cache. (we have three now btw.) --- Shokofin/Tasks/PostScanTask.cs | 17 +++++++++++++---- 1 file changed, 13 insertions(+), 4 deletions(-) diff --git a/Shokofin/Tasks/PostScanTask.cs b/Shokofin/Tasks/PostScanTask.cs index 07a79fa1..af809700 100644 --- a/Shokofin/Tasks/PostScanTask.cs +++ b/Shokofin/Tasks/PostScanTask.cs @@ -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; @@ -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; } @@ -49,6 +56,8 @@ public async Task Run(IProgress progress, CancellationToken token) } // Clear the cache now, since we don't need it anymore. + ApiClient.Clear(); ApiManager.Clear(); + ResolveManager.Clear(); } }