fix: calculate average time when no queue
parent
4a3e77043e
commit
f661276c58
|
@ -28,7 +28,7 @@ export class QueueTimeFormula {
|
|||
});
|
||||
|
||||
const times = itemQueue.items.map((item) => item.play_estimation ?? 0);
|
||||
const average = math.mean(times) * 60 * 1000; // change average minute to milliseconds
|
||||
const average = times.length > 0 ? math.mean(times) * 60 * 1000 : 0; // change average minute to milliseconds
|
||||
|
||||
const calledQueue = await this.queueDataService.lastQueue(item_queue_id);
|
||||
|
||||
|
|
Loading…
Reference in New Issue