Update generate.js

This commit is contained in:
Aleksandr Statciuk 2021-08-03 02:30:26 +03:00
parent 7bd78d7bc0
commit 06b204c4e8
1 changed files with 13 additions and 13 deletions

View File

@ -8,15 +8,15 @@ async function main() {
await loadDatabase() await loadDatabase()
createRootDirectory() createRootDirectory()
createNoJekyllFile() createNoJekyllFile()
generateIndex() // generateIndex()
generateCategoryIndex() // generateCategoryIndex()
generateCountryIndex() generateCountryIndex()
generateLanguageIndex() generateLanguageIndex()
generateCategories() // generateCategories()
generateCountries() // generateCountries()
generateLanguages() // generateLanguages()
generateChannelsJson() // generateChannelsJson()
showResults() // showResults()
} }
async function loadDatabase() { async function loadDatabase() {
@ -74,13 +74,13 @@ function generateCountryIndex() {
.removeDuplicates() .removeDuplicates()
.get() .get()
for (const channel of channels) { for (const channel of channels) {
const category = channel.category const groupTitle = channel.group.title
const nsfw = channel.isNSFW() const nsfw = channel.isNSFW()
channel.category = country.name || '' channel.group.title = country.name || ''
if (!nsfw) { if (!nsfw) {
file.append(filename, channel.toString()) file.append(filename, channel.toString())
} }
channel.category = category channel.group.title = groupTitle
} }
} }
} }
@ -97,13 +97,13 @@ function generateLanguageIndex() {
.removeDuplicates() .removeDuplicates()
.get() .get()
for (const channel of channels) { for (const channel of channels) {
const category = channel.category const groupTitle = channel.group.title
const nsfw = channel.isNSFW() const nsfw = channel.isNSFW()
channel.category = language.name || '' channel.group.title = language.name || ''
if (!nsfw) { if (!nsfw) {
file.append(filename, channel.toString()) file.append(filename, channel.toString())
} }
channel.category = category channel.group.title = groupTitle
} }
} }
} }