From 29d0e3ae5574a45a7eb1318fd0f894e49f459c62 Mon Sep 17 00:00:00 2001 From: schroda <50052685+schroda@users.noreply.github.com> Date: Fri, 30 May 2025 21:26:35 +0200 Subject: [PATCH] Update download status state via subscription The download query type (DownloadStatus) and download subscription type (DownloadUpdates) are different. This means that the download state in the cache does not get automatically updated from the state provided in the subscription. --- src/lib/requests/RequestManager.ts | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/src/lib/requests/RequestManager.ts b/src/lib/requests/RequestManager.ts index b8bbd2ed..baffb295 100644 --- a/src/lib/requests/RequestManager.ts +++ b/src/lib/requests/RequestManager.ts @@ -2970,6 +2970,17 @@ export class RequestManager { return; } + if (downloadChanged?.state) { + cache.modify({ + id: 'DownloadStatus:{}', + fields: { + state() { + return downloadChanged.state; + }, + }, + }); + } + downloadChanged?.updates.forEach((update) => { if (![DownloadUpdateType.Dequeued, DownloadUpdateType.Finished].includes(update.type)) { return;