mirror of
https://github.com/iptv-org/iptv
synced 2026-10-22 02:56:48 -04:00
Update db.js
This commit is contained in:
1 parent
f945b10bf8
commit
a483e4887b
1 file changed
+9
@@ -40,9 +40,13 @@ db.channels = {
|
||||
return this.list.filter(channel => channel.countries.map(c => c.code).includes(country.code))
|
||||
},
|
||||
forLanguage(language) {
|
||||
if (!language.code) return this.list.filter(channel => !channel.languages.length)
|
||||
|
||||
return this.list.filter(channel => channel.languages.map(c => c.code).includes(language.code))
|
||||
},
|
||||
forCategory(category) {
|
||||
if (!category.id) return this.list.filter(channel => !channel.category)
|
||||
|
||||
return this.list.filter(channel => channel.category.toLowerCase() === category.id)
|
||||
},
|
||||
count() {
|
||||
@@ -89,6 +93,11 @@ db.languages = {
|
||||
},
|
||||
count() {
|
||||
return this.list.length
|
||||
},
|
||||
sortBy(fields) {
|
||||
this.list = utils.sortBy(this.list, fields)
|
||||
|
||||
return this
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in new issue
Block a user