From 61b2a014f7ab3a15c47fd01eba1f5638d1fe3652 Mon Sep 17 00:00:00 2001 From: Aleksandr Statciuk Date: Sun, 1 Aug 2021 20:31:46 +0300 Subject: [PATCH] Update db.js --- scripts/helpers/db.js | 9 ++------- 1 file changed, 2 insertions(+), 7 deletions(-) diff --git a/scripts/helpers/db.js b/scripts/helpers/db.js index a0d67cb4dd..417742f847 100644 --- a/scripts/helpers/db.js +++ b/scripts/helpers/db.js @@ -2,14 +2,12 @@ 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 () { +db.load = async function () { const items = parser.parseIndex() for (const item of items) { - const playlist = parser.parsePlaylist(item.url) + const playlist = await parser.parsePlaylist(item.url) db.playlists.add(playlist) for (const channel of playlist.channels) { db.channels.add(channel) @@ -107,9 +105,6 @@ db.channels = { all() { return this.list }, - sfw() { - return this.list.filter(i => sfwCategories.includes(i.category)) - }, forCountry(country) { this.filter = { field: 'countries',