From 54b30b8af53c1c021611b2840aa927ef8020a63f Mon Sep 17 00:00:00 2001 From: freearhey Date: Thu, 8 Aug 2019 02:43:43 +0300 Subject: [PATCH] Clear cache before parsing each playlist --- helpers/format.js | 7 +++++-- helpers/generate.js | 2 ++ 2 files changed, 7 insertions(+), 2 deletions(-) diff --git a/helpers/format.js b/helpers/format.js index 2e53929cf..2d5e981b5 100644 --- a/helpers/format.js +++ b/helpers/format.js @@ -15,11 +15,14 @@ async function main() { let countries = playlist.items if(debug) { console.log('Debug mode is turn on') - countries = countries.slice(0, 1) - // countries = [{ url: 'channels/ru.m3u' }] + // countries = countries.slice(0, 1) + countries = [{ url: 'channels/ru.m3u' }, { url: 'channels/ua.m3u' }] } for(let country of countries) { + console.log(`Clear cache...`) + util.clearCache() + console.log(`Parsing '${country.url}'...`) const playlist = util.parsePlaylist(country.url) diff --git a/helpers/generate.js b/helpers/generate.js index 5804826fd..6fdca747c 100644 --- a/helpers/generate.js +++ b/helpers/generate.js @@ -24,6 +24,8 @@ function main() { } for(let country of countries) { + console.log(`Clear cache...`) + util.clearCache() console.log(`Parsing '${country.url}'...`) const playlist = util.parsePlaylist(country.url)