feat: improving caching

This commit is contained in:
Chubby Granny Chaser
2025-10-15 13:58:40 +01:00
parent 136a44473f
commit 24106eaeab
35 changed files with 246 additions and 1061 deletions

View File

@@ -8,7 +8,6 @@ import {
CommonRedistManager,
TorBoxClient,
RealDebridClient,
AllDebridClient,
Aria2,
DownloadManager,
HydraApi,
@@ -17,11 +16,15 @@ import {
Ludusavi,
Lock,
DeckyPlugin,
ResourceCache,
} from "@main/services";
export const loadState = async () => {
await Lock.acquireLock();
ResourceCache.initialize();
await ResourceCache.updateResourcesOnStartup();
const userPreferences = await db.get<string, UserPreferences | null>(
levelKeys.userPreferences,
{
@@ -39,10 +42,6 @@ export const loadState = async () => {
RealDebridClient.authorize(userPreferences.realDebridApiToken);
}
if (userPreferences?.allDebridApiKey) {
AllDebridClient.authorize(userPreferences.allDebridApiKey);
}
if (userPreferences?.torBoxApiToken) {
TorBoxClient.authorize(userPreferences.torBoxApiToken);
}