Update languages.js

This commit is contained in:
Aleksandr Statciuk 2022-02-12 07:01:12 +03:00
parent dc2cc12cc2
commit 0c7ff309bc
1 changed files with 4 additions and 3 deletions

View File

@ -1,11 +1,12 @@
const api = require('../core/api')
const _ = require('lodash')
module.exports = async function (streams = []) {
streams = _.filter(streams, stream => stream.is_nsfw === false)
await api.languages.load()
let languages = await api.languages.all()
let languages = []
streams.forEach(stream => {
languages = languages.concat(stream.languages)
})
languages = _.uniqBy(languages, 'code')
const output = []