diff --git a/scripts/db.js b/scripts/db.js
index 75cf792ff7..58ee0dacb5 100644
--- a/scripts/db.js
+++ b/scripts/db.js
@@ -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
},
diff --git a/scripts/update-readme.js b/scripts/update-readme.js
index c1a3faa4e1..3f20e0a73f 100644
--- a/scripts/update-readme.js
+++ b/scripts/update-readme.js
@@ -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: `https://iptv-org.github.io/iptv/countries/${country.code}.m3u
`
})
}
@@ -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: `https://iptv-org.github.io/iptv/languages/${language.code}.m3u
`
})
}