diff --git a/server/src/main.ts b/server/src/main.ts index 21a706c..e737879 100644 --- a/server/src/main.ts +++ b/server/src/main.ts @@ -94,7 +94,7 @@ export async function addToQueue(dz: any, url: string[], bitrate: number) { return slimmedObjects } -async function startQueue(dz: any): Promise { +export async function startQueue(dz: any): Promise { do { if (currentJob !== null || queueOrder.length === 0) { // Should not start another download diff --git a/server/src/routes/api/post/login-arl.ts b/server/src/routes/api/post/login-arl.ts index c58e7ab..40296aa 100644 --- a/server/src/routes/api/post/login-arl.ts +++ b/server/src/routes/api/post/login-arl.ts @@ -1,7 +1,7 @@ import { RequestHandler } from 'express' // @ts-expect-error import { Deezer } from 'deezer-js' -import { sessionDZ } from '../../../main' +import { sessionDZ, startQueue } from '../../../main' import { ApiHandler } from '../../../types' export interface RawLoginArlQuery { @@ -58,6 +58,7 @@ const handler: RequestHandler<{}, {}, {}, RawLoginArlQuery> = async (req, res, n const returnValue = { status: response, arl: req.query.arl, user: dz.current_user } res.status(200).send(returnValue) + startQueue(dz) next() }