From 4c457f98fae25171bd3413b1492b2e33181913ea Mon Sep 17 00:00:00 2001 From: freearhey Date: Mon, 1 Mar 2021 01:21:13 +0300 Subject: [PATCH] Update format.js Ignore protocol during duplicates search for unsorted channels too --- scripts/format.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/scripts/format.js b/scripts/format.js index 080a57c6d..9ef441d27 100644 --- a/scripts/format.js +++ b/scripts/format.js @@ -184,8 +184,8 @@ async function updateFromEPG(playlist) { async function removeUnsortedDuplicates(playlist) { console.info(` Looking for duplicates...`) - const urls = globalBuffer.map(i => i.url) - const channels = playlist.channels.filter(i => !urls.includes(i.url)) + const urls = globalBuffer.map(i => i.url.replace(/(^\w+:|^)\/\//, '')) + const channels = playlist.channels.filter(i => !urls.includes(i.url.replace(/(^\w+:|^)\/\//, ''))) if (channels.length === playlist.channels.length) return playlist playlist.channels = channels