From 6705b00f59368129b62c86f18a09d467dbbe5de9 Mon Sep 17 00:00:00 2001 From: Aleksandr Statciuk Date: Thu, 3 Mar 2022 22:01:41 +0300 Subject: [PATCH 1/4] Update parse.js --- scripts/commands/channels/parse.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/scripts/commands/channels/parse.js b/scripts/commands/channels/parse.js index 11b76958..395d5fa6 100644 --- a/scripts/commands/channels/parse.js +++ b/scripts/commands/channels/parse.js @@ -33,7 +33,7 @@ async function main() { await file.write(outputFilepath, output) - logger.info(`File '${output}' successfully saved`) + logger.info(`File '${outputFilepath}' successfully saved`) } main() From 0d24a12c8c401acea737466d502daf38ecbcd254 Mon Sep 17 00:00:00 2001 From: Aleksandr Statciuk Date: Fri, 4 Mar 2022 00:38:35 +0300 Subject: [PATCH 2/4] Update api.js --- scripts/core/api.js | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/scripts/core/api.js b/scripts/core/api.js index 97f2ad21..575dad99 100644 --- a/scripts/core/api.js +++ b/scripts/core/api.js @@ -16,6 +16,10 @@ class API { find(query) { return _.find(this.collection, query) } + + all() { + return this.collection + } } const api = {} From 9a9b8ba52fdde92794f61f471ecf4885516d05e1 Mon Sep 17 00:00:00 2001 From: Aleksandr Statciuk Date: Fri, 4 Mar 2022 00:38:47 +0300 Subject: [PATCH 3/4] Update file.js --- scripts/core/file.js | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/scripts/core/file.js b/scripts/core/file.js index d191cc84..d3c7b384 100644 --- a/scripts/core/file.js +++ b/scripts/core/file.js @@ -48,6 +48,10 @@ file.write = function (filepath, data = '') { return fs.writeFile(path.resolve(filepath), data, { encoding: 'utf8' }).catch(console.error) } +file.writeSync = function (filepath, data = '') { + return fs.writeFileSync(path.resolve(filepath), data, { encoding: 'utf8' }) +} + file.clear = async function (filepath) { if (await file.exists(filepath)) return file.write(filepath, '') return true From 4e3c687e733408d4d3f92f57ad005efa832ef752 Mon Sep 17 00:00:00 2001 From: Aleksandr Statciuk Date: Fri, 4 Mar 2022 00:39:00 +0300 Subject: [PATCH 4/4] Update parser.js --- scripts/core/parser.js | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/scripts/core/parser.js b/scripts/core/parser.js index e320bf70..892db44c 100644 --- a/scripts/core/parser.js +++ b/scripts/core/parser.js @@ -4,11 +4,10 @@ const grabber = require('epg-grabber') const parser = {} -parser.parseChannels = async function(filepath) { +parser.parseChannels = async function (filepath) { const content = await file.read(filepath) - const channels = grabber.parseChannels(content) - return channels + return grabber.parseChannels(content) } parser.parseLogs = async function (filepath) {