Update generate.js
This commit is contained in:
parent
7bd78d7bc0
commit
06b204c4e8
|
@ -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
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue