diff --git a/Wabbajack.Services.OSIntegrated/ServiceExtensions.cs b/Wabbajack.Services.OSIntegrated/ServiceExtensions.cs index e7e424cc..fc50ba65 100644 --- a/Wabbajack.Services.OSIntegrated/ServiceExtensions.cs +++ b/Wabbajack.Services.OSIntegrated/ServiceExtensions.cs @@ -6,6 +6,7 @@ using System.Net.Http; using System.Runtime.InteropServices; using System.Threading.Tasks; using Microsoft.Extensions.DependencyInjection; +using Microsoft.Extensions.Logging; using Wabbajack.App.Models; using Wabbajack.Compiler; using Wabbajack.Downloaders; @@ -20,6 +21,7 @@ using Wabbajack.Networking.Http; using Wabbajack.Networking.Http.Interfaces; using Wabbajack.Networking.NexusApi; using Wabbajack.Networking.Steam; +using Wabbajack.Networking.WabbajackClientApi; using Wabbajack.Paths; using Wabbajack.Paths.IO; using Wabbajack.RateLimiter; @@ -56,9 +58,15 @@ public static class ServiceExtensions : new FileHashCache(KnownFolders.AppDataLocal.Combine("Wabbajack", "GlobalHashCache.sqlite"), s.GetService>()!)); - service.AddAllSingleton(s => options.UseLocalCache - ? new VFSDiskCache(s.GetService()!.CreateFile().Path) - : new VFSDiskCache(KnownFolders.EntryPoint.Combine("GlobalVFSCache3.sqlite"))); + service.AddSingleton(s => + { + var diskCache = options.UseLocalCache + ? new VFSDiskCache(s.GetService()!.CreateFile().Path) + : new VFSDiskCache(KnownFolders.EntryPoint.Combine("GlobalVFSCache3.sqlite")); + var cesiCache = new CesiVFSCache(s.GetRequiredService>(), + s.GetRequiredService()); + return new FallthroughVFSCache(new IVfsCache[] {diskCache, cesiCache}); + }); service.AddSingleton(s => options.UseLocalCache ? new BinaryPatchCache(s.GetService()!.CreateFile().Path)