From 919ba2f8c70399dd9cdd6707f9250fa608bda87b Mon Sep 17 00:00:00 2001 From: freearhey Date: Fri, 7 May 2021 18:34:20 +0300 Subject: [PATCH] Update db.js --- scripts/db.js | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/scripts/db.js b/scripts/db.js index 91795217e..e4072cbd0 100644 --- a/scripts/db.js +++ b/scripts/db.js @@ -2,6 +2,8 @@ const categories = require('./categories') const parser = require('./parser') const utils = require('./utils') +const sfwCategories = categories.filter(c => !c.nsfw).map(c => c.name) + const db = {} db.load = function () { @@ -38,7 +40,7 @@ db.channels = { if (this.filter) { switch (this.filter.field) { case 'countries': - if (!this.filter.value) { + if (this.filter.value === 'undefined') { output = this.list.filter(channel => !channel.countries.length) } else { output = this.list.filter(channel => @@ -47,7 +49,7 @@ db.channels = { } break case 'languages': - if (!this.filter.value) { + if (this.filter.value === 'undefined') { output = this.list.filter(channel => !channel.languages.length) } else { output = this.list.filter(channel => @@ -56,7 +58,7 @@ db.channels = { } break case 'category': - if (!this.filter.value) { + if (this.filter.value === 'other') { output = this.list.filter(channel => !channel.category) } else { output = this.list.filter( @@ -77,8 +79,6 @@ db.channels = { return this.list }, sfw() { - const sfwCategories = categories.filter(c => !c.nsfw).map(c => c.name) - return this.list.filter(i => sfwCategories.includes(i.category)) }, forCountry(country) {