display eng lang for dub anime

This commit is contained in:
TheBeastLT
2023-10-30 19:15:05 +02:00
parent 8e0cd5ba14
commit 9013ab1d04

View File

@@ -73,10 +73,9 @@ function getLanguages(record, torrentInfo, fileInfo) {
const dubbed = torrentInfo.dubbed || fileInfo.dubbed; const dubbed = torrentInfo.dubbed || fileInfo.dubbed;
let languages = Array.from(new Set([].concat(torrentLanguages).concat(fileLanguages).concat(providerLanguages))); let languages = Array.from(new Set([].concat(torrentLanguages).concat(fileLanguages).concat(providerLanguages)));
if (record.kitsuId || record.torrent.type === Type.ANIME) { if (record.kitsuId || record.torrent.type === Type.ANIME) {
// no need to display japanese for anime or english if anime is dubbed // no need to display japanese for anime
languages = languages.concat(dubbed ? ['dubbed'] : []) languages = languages.concat(dubbed ? ['dubbed'] : [])
.filter(lang => lang !== 'japanese') .filter(lang => lang !== 'japanese');
.filter(lang => dubbed && lang !== 'english' || !dubbed);
} }
if (languages.length === 1 && languages.includes('english')) { if (languages.length === 1 && languages.includes('english')) {
// no need to display languages if only english is present // no need to display languages if only english is present