Update remove-duplicates.js

This commit is contained in:
Aleksandr Statciuk 2021-08-01 19:56:02 +03:00
parent 2eddce0e83
commit d9dc411cfd
1 changed files with 6 additions and 6 deletions

View File

@ -1,6 +1,6 @@
const parser = require('./parser') const parser = require('./helpers/parser')
const utils = require('./utils') const utils = require('./helpers/utils')
const log = require('./log') const log = require('./helpers/log')
let globalBuffer = [] let globalBuffer = []
@ -15,7 +15,7 @@ async function main() {
.parsePlaylist(playlist.url) .parsePlaylist(playlist.url)
.then(addToBuffer) .then(addToBuffer)
.then(removeDuplicates) .then(removeDuplicates)
.then(utils.savePlaylist) .then(p => p.save())
} }
if (playlists.length) { if (playlists.length) {
@ -23,14 +23,14 @@ async function main() {
await parser await parser
.parsePlaylist('channels/unsorted.m3u') .parsePlaylist('channels/unsorted.m3u')
.then(removeUnsortedDuplicates) .then(removeUnsortedDuplicates)
.then(utils.savePlaylist) .then(p => p.save())
} }
log.print('\n')
log.finish() log.finish()
} }
async function addToBuffer(playlist) { async function addToBuffer(playlist) {
if (playlist.url === 'channels/unsorted.m3u') return playlist
globalBuffer = globalBuffer.concat(playlist.channels) globalBuffer = globalBuffer.concat(playlist.channels)
return playlist return playlist