Merge pull request #3045 from iptv-org/fix-channel-counter

Fix channel counter
This commit is contained in:
Aleksandr Statciuk 2021-06-06 13:23:12 +03:00 committed by GitHub
commit c889cd1574
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 12 additions and 2 deletions

View File

@ -83,6 +83,11 @@ db.channels = {
})
}
if (!this.nsfw) {
output = output.filter(channel => !channel.isNSFW())
}
this.nsfw = true
this.duplicates = true
this.filter = null
@ -93,6 +98,11 @@ db.channels = {
return this
},
removeNSFW() {
this.nsfw = false
return this
},
all() {
return this.list
},

View File

@ -48,7 +48,7 @@ function generateCountriesTable() {
const prefix = flag ? `${flag} ` : ''
countries.push({
country: prefix + country.name,
channels: db.channels.forCountry(country).removeDuplicates().count(),
channels: db.channels.forCountry(country).removeDuplicates().removeNSFW().count(),
playlist: `<code>https://iptv-org.github.io/iptv/countries/${country.code}.m3u</code>`
})
}
@ -74,7 +74,7 @@ function generateLanguagesTable() {
]) {
languages.push({
language: language.name,
channels: db.channels.forLanguage(language).removeDuplicates().count(),
channels: db.channels.forLanguage(language).removeDuplicates().removeNSFW().count(),
playlist: `<code>https://iptv-org.github.io/iptv/languages/${language.code}.m3u</code>`
})
}