mirror of
https://github.com/iptv-org/iptv.git
synced 2024-09-05 00:01:35 +02:00
Update generate.js
This commit is contained in:
parent
a1dfa0f942
commit
1c1331e038
@ -81,14 +81,14 @@ function parseIndex() {
|
|||||||
}
|
}
|
||||||
|
|
||||||
// language
|
// language
|
||||||
if (!channel.language.length) {
|
if (!channel.languages.length) {
|
||||||
const languageCode = 'undefined'
|
const languageCode = 'undefined'
|
||||||
if (!list.languages[languageCode]) {
|
if (!list.languages[languageCode]) {
|
||||||
list.languages[languageCode] = []
|
list.languages[languageCode] = []
|
||||||
}
|
}
|
||||||
list.languages[languageCode].push(channel)
|
list.languages[languageCode].push(channel)
|
||||||
} else {
|
} else {
|
||||||
for (let language of channel.language) {
|
for (let language of channel.languages) {
|
||||||
const languageCode = language.code || 'undefined'
|
const languageCode = language.code || 'undefined'
|
||||||
if (!list.languages[languageCode]) {
|
if (!list.languages[languageCode]) {
|
||||||
list.languages[languageCode] = []
|
list.languages[languageCode] = []
|
||||||
@ -139,7 +139,7 @@ function generateCountryIndex() {
|
|||||||
const filename = `${ROOT_DIR}/index.country.m3u`
|
const filename = `${ROOT_DIR}/index.country.m3u`
|
||||||
helper.createFile(filename, '#EXTM3U\n')
|
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) {
|
for (let channel of channels) {
|
||||||
const category = channel.category
|
const category = channel.category
|
||||||
channel.category = channel.countries.map(c => c.name).join(';')
|
channel.category = channel.countries.map(c => c.name).join(';')
|
||||||
@ -152,7 +152,7 @@ function generateLanguageIndex() {
|
|||||||
const filename = `${ROOT_DIR}/index.language.m3u`
|
const filename = `${ROOT_DIR}/index.language.m3u`
|
||||||
helper.createFile(filename, '#EXTM3U\n')
|
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) {
|
for (let channel of channels) {
|
||||||
const category = channel.category
|
const category = channel.category
|
||||||
channel.category = channel.getLanguageAttribute()
|
channel.category = channel.getLanguageAttribute()
|
||||||
|
Loading…
Reference in New Issue
Block a user