From d9dc411cfd7f93f883f839c641d5cf7f20f74d09 Mon Sep 17 00:00:00 2001 From: Aleksandr Statciuk Date: Sun, 1 Aug 2021 19:56:02 +0300 Subject: [PATCH] Update remove-duplicates.js --- scripts/remove-duplicates.js | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/scripts/remove-duplicates.js b/scripts/remove-duplicates.js index 8b21c748df..f2d62e919e 100644 --- a/scripts/remove-duplicates.js +++ b/scripts/remove-duplicates.js @@ -1,6 +1,6 @@ -const parser = require('./parser') -const utils = require('./utils') -const log = require('./log') +const parser = require('./helpers/parser') +const utils = require('./helpers/utils') +const log = require('./helpers/log') let globalBuffer = [] @@ -15,7 +15,7 @@ async function main() { .parsePlaylist(playlist.url) .then(addToBuffer) .then(removeDuplicates) - .then(utils.savePlaylist) + .then(p => p.save()) } if (playlists.length) { @@ -23,14 +23,14 @@ async function main() { await parser .parsePlaylist('channels/unsorted.m3u') .then(removeUnsortedDuplicates) - .then(utils.savePlaylist) + .then(p => p.save()) } + log.print('\n') log.finish() } async function addToBuffer(playlist) { - if (playlist.url === 'channels/unsorted.m3u') return playlist globalBuffer = globalBuffer.concat(playlist.channels) return playlist