From 06b62795748e68ced94d8b953bac0dcf5baa4afe Mon Sep 17 00:00:00 2001 From: freearhey Date: Sat, 20 Jul 2019 10:32:16 +0300 Subject: [PATCH] Rename to format.js --- helpers/{formatter.js => format.js} | 6 ++++-- package.json | 2 +- 2 files changed, 5 insertions(+), 3 deletions(-) rename helpers/{formatter.js => format.js} (82%) diff --git a/helpers/formatter.js b/helpers/format.js similarity index 82% rename from helpers/formatter.js rename to helpers/format.js index ff7bfd9efd..5f3abc1b1c 100644 --- a/helpers/formatter.js +++ b/helpers/format.js @@ -27,12 +27,14 @@ function init() { channels = util.sortByTitle(channels) - util.createFile(country.file) + util.createFile(country.file, '#EXTM3U\n') channels.forEach(channel => { const info = `-1 tvg-id="${channel.id}" tvg-name="${channel.name}" tvg-logo="${channel.logo}" group-title="${channel.group}",${channel.title}` - util.writeToFile(country.file, info, channel.file) + const data = '#EXTINF:' + info + '\n' + channel.file + '\n' + + util.writeToFile(country.file, data) }) total += channels.length diff --git a/package.json b/package.json index b8462ea28e..fce6d373c8 100644 --- a/package.json +++ b/package.json @@ -10,7 +10,7 @@ "scripts": { "test": "node test/index.js", "generate": "node helpers/generate.js", - "format": "node helpers/formatter.js" + "format": "node helpers/format.js" }, "repository": { "type": "git",