From 9bab29bf38db3151c6f227c9b7c3382b47d198da Mon Sep 17 00:00:00 2001 From: Aleksandr Statciuk Date: Fri, 6 Aug 2021 07:49:46 +0300 Subject: [PATCH] Update db.js --- scripts/helpers/db.js | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/scripts/helpers/db.js b/scripts/helpers/db.js index 417742f847..f94ce678a1 100644 --- a/scripts/helpers/db.js +++ b/scripts/helpers/db.js @@ -31,6 +31,7 @@ db.channels = { list: [], filter: null, duplicates: true, + offline: true, nsfw: true, add(channel) { this.list.push(channel) @@ -86,8 +87,13 @@ db.channels = { output = output.filter(channel => !channel.isNSFW()) } + if (!this.offline) { + output = output.filter(channel => channel.status !== 'Offline') + } + this.nsfw = true this.duplicates = true + this.offline = true this.filter = null return output @@ -102,6 +108,11 @@ db.channels = { return this }, + removeOffline() { + this.offline = false + + return this + }, all() { return this.list },