From e0c6f2875320c1955f32892a097a38b8f2969561 Mon Sep 17 00:00:00 2001 From: Aman Karmani Date: Wed, 20 Oct 2021 09:26:39 -0700 Subject: [PATCH] write sorted list to cache --- PlutoIPTV/index.js | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/PlutoIPTV/index.js b/PlutoIPTV/index.js index 5ebc445..148d4b7 100755 --- a/PlutoIPTV/index.js +++ b/PlutoIPTV/index.js @@ -288,12 +288,11 @@ const plutoIPTV = { }); fullChannels = Object.values(channelsList); - console.log("[DEBUG] Using api.pluto.tv, writing cache.json."); - fs.writeFileSync("cache.json", JSON.stringify(fullChannels)); - sortedChannels = fullChannels.sort( ({ number: a }, { number: b }) => a - b ); + console.log("[DEBUG] Using api.pluto.tv, writing cache.json."); + fs.writeFileSync("cache.json", JSON.stringify(sortedChannels)); callback(sortedChannels); return; });