Added autostart queue after login

This commit is contained in:
RemixDev 2021-05-21 12:34:52 +02:00
parent b384b4638f
commit 6f7808c91b
2 changed files with 3 additions and 2 deletions

View File

@ -94,7 +94,7 @@ export async function addToQueue(dz: any, url: string[], bitrate: number) {
return slimmedObjects return slimmedObjects
} }
async function startQueue(dz: any): Promise<any> { export async function startQueue(dz: any): Promise<any> {
do { do {
if (currentJob !== null || queueOrder.length === 0) { if (currentJob !== null || queueOrder.length === 0) {
// Should not start another download // Should not start another download

View File

@ -1,7 +1,7 @@
import { RequestHandler } from 'express' import { RequestHandler } from 'express'
// @ts-expect-error // @ts-expect-error
import { Deezer } from 'deezer-js' import { Deezer } from 'deezer-js'
import { sessionDZ } from '../../../main' import { sessionDZ, startQueue } from '../../../main'
import { ApiHandler } from '../../../types' import { ApiHandler } from '../../../types'
export interface RawLoginArlQuery { 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 } const returnValue = { status: response, arl: req.query.arl, user: dz.current_user }
res.status(200).send(returnValue) res.status(200).send(returnValue)
startQueue(dz)
next() next()
} }