From b384b4638f8fe9c4659befdb46fd6fcf71ab7f7c Mon Sep 17 00:00:00 2001 From: RemixDev Date: Fri, 21 May 2021 12:34:39 +0200 Subject: [PATCH] Fixed queue restoring issues --- server/src/main.ts | 1 + server/src/routes/api/get/getQueue.ts | 7 +++---- server/src/routes/index.ts | 2 +- webui | 2 +- 4 files changed, 6 insertions(+), 6 deletions(-) diff --git a/server/src/main.ts b/server/src/main.ts index 485b46b..21a706c 100644 --- a/server/src/main.ts +++ b/server/src/main.ts @@ -137,6 +137,7 @@ async function startQueue(dz: any): Promise { savedObject.status = queue[currentUUID].status // Save queue status + queue[currentUUID] = savedObject fs.writeFileSync(configFolder + `queue${sep}${currentUUID}.json`, JSON.stringify(savedObject)) } console.log(queueOrder) diff --git a/server/src/routes/api/get/getQueue.ts b/server/src/routes/api/get/getQueue.ts index b6521fc..479d890 100644 --- a/server/src/routes/api/get/getQueue.ts +++ b/server/src/routes/api/get/getQueue.ts @@ -7,12 +7,11 @@ const path: ApiHandler['path'] = '/getQueue' // let homeCache: any const handler: ApiHandler['handler'] = (_, res) => { - const result = { + const result:any = { queue, - order: queueOrder, - currentItem: '' + order: queueOrder } - if (currentJob) result.currentItem = currentJob.downloadObject.uuid + if (currentJob) result.currentItem = currentJob.downloadObject.getSlimmedDict() res.send(result) } diff --git a/server/src/routes/index.ts b/server/src/routes/index.ts index 9d76971..a1004f2 100644 --- a/server/src/routes/index.ts +++ b/server/src/routes/index.ts @@ -36,7 +36,7 @@ router.get('/connect', (req, res) => { queueOrder } if (currentJob && currentJob !== true) { - result.queue.current = currentJob.downloadObject.uuid + result.queue.current = currentJob.downloadObject.getSlimmedDict() } } diff --git a/webui b/webui index 3ee56d0..122d103 160000 --- a/webui +++ b/webui @@ -1 +1 @@ -Subproject commit 3ee56d020b49dd905beb0189de55ce32137da7a1 +Subproject commit 122d103959170433d28b6cb1559679ee6b7077a1