Update generate.js

This commit is contained in:
freearhey 2021-01-27 18:19:43 +03:00
parent a41bda5f5e
commit ee03a3c727
1 changed files with 2 additions and 1 deletions

View File

@ -181,11 +181,12 @@ function generateCategories() {
const outputDir = `${ROOT_DIR}/categories` const outputDir = `${ROOT_DIR}/categories`
helper.createDir(outputDir) helper.createDir(outputDir)
for (let cid in list.categories) { for (let cid in helper.supportedCategories) {
let category = list.categories[cid] let category = list.categories[cid]
const filename = `${outputDir}/${cid}.m3u` const filename = `${outputDir}/${cid}.m3u`
helper.createFile(filename, '#EXTM3U\n') helper.createFile(filename, '#EXTM3U\n')
if (!category) continue
const channels = helper.sortBy(Object.values(category), ['name', 'url']) const channels = helper.sortBy(Object.values(category), ['name', 'url'])
for (let channel of channels) { for (let channel of channels) {
helper.appendToFile(filename, channel.toString()) helper.appendToFile(filename, channel.toString())