From 738546b64f39cbf25ee598075de2144407ff4629 Mon Sep 17 00:00:00 2001 From: Aleksandr Statciuk Date: Tue, 1 Feb 2022 02:27:58 +0300 Subject: [PATCH] Update load-cluster.js --- scripts/commands/load-cluster.js | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/scripts/commands/load-cluster.js b/scripts/commands/load-cluster.js index a22811c0..ddfe5848 100644 --- a/scripts/commands/load-cluster.js +++ b/scripts/commands/load-cluster.js @@ -26,7 +26,8 @@ async function main() { logger.info(`Creating '${CLUSTER_PATH}'...`) await file.create(CLUSTER_PATH) await db.queue.load() - const items = await db.queue.find({ cluster_id: options.clusterId }) + let items = await db.queue.find({ cluster_id: options.clusterId }) + items = _.orderBy(items, [i => i.channel.xmltv_id.toLowerCase(), 'date']) const total = items.length logger.info('Loading...')