From d1bca8590fe12e42d49483c99012473a9bb5d966 Mon Sep 17 00:00:00 2001 From: Aleksandr Statciuk Date: Mon, 1 May 2023 21:33:30 +0300 Subject: [PATCH] Update format.js --- scripts/commands/playlist/format.js | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/scripts/commands/playlist/format.js b/scripts/commands/playlist/format.js index 08f3ec9211..f1c62203ef 100644 --- a/scripts/commands/playlist/format.js +++ b/scripts/commands/playlist/format.js @@ -1,4 +1,5 @@ const { create: createPlaylist } = require('../../core/playlist') +const { normalize: normalizeUrl } = require('../../core/url') const { db, logger, file } = require('../../core') const { orderBy } = require('natural-orderby') const _ = require('lodash') @@ -8,6 +9,12 @@ async function main() { await db.streams.load() let streams = await db.streams.find({}) + streams = streams.map(stream => { + stream.url = normalizeUrl(stream.url) + + return stream + }) + logger.info('sorting links...') streams = orderBy( streams,