From 1c1331e038722744d62f96c67152aeb031ef2c0a Mon Sep 17 00:00:00 2001 From: freearhey Date: Fri, 29 Jan 2021 22:16:33 +0300 Subject: [PATCH] Update generate.js --- scripts/generate.js | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/scripts/generate.js b/scripts/generate.js index 89b1c8e4ac..f8a6d55aef 100644 --- a/scripts/generate.js +++ b/scripts/generate.js @@ -81,14 +81,14 @@ function parseIndex() { } // language - if (!channel.language.length) { + if (!channel.languages.length) { const languageCode = 'undefined' if (!list.languages[languageCode]) { list.languages[languageCode] = [] } list.languages[languageCode].push(channel) } else { - for (let language of channel.language) { + for (let language of channel.languages) { const languageCode = language.code || 'undefined' if (!list.languages[languageCode]) { list.languages[languageCode] = [] @@ -139,7 +139,7 @@ function generateCountryIndex() { const filename = `${ROOT_DIR}/index.country.m3u` helper.createFile(filename, '#EXTM3U\n') - const channels = helper.sortBy(list.all, ['countryName', 'name', 'url']) + const channels = helper.sortBy(list.all, ['countryAttribute', 'name', 'url']) for (let channel of channels) { const category = channel.category channel.category = channel.countries.map(c => c.name).join(';') @@ -152,7 +152,7 @@ function generateLanguageIndex() { const filename = `${ROOT_DIR}/index.language.m3u` helper.createFile(filename, '#EXTM3U\n') - const channels = helper.sortBy(list.all, ['languageName', 'name', 'url']) + const channels = helper.sortBy(list.all, ['languageAttribute', 'name', 'url']) for (let channel of channels) { const category = channel.category channel.category = channel.getLanguageAttribute()