From 14dc202cdea3d56a3013363a67322a1859f4aa50 Mon Sep 17 00:00:00 2001 From: TheBeastLT Date: Fri, 7 Oct 2022 23:54:22 +0200 Subject: [PATCH] allow excluding remux and hdr qualities, closes #67 --- addon/lib/filter.js | 27 ++++++++++++++++++++++++++- 1 file changed, 26 insertions(+), 1 deletion(-) diff --git a/addon/lib/filter.js b/addon/lib/filter.js index 6a93dd2..ea7e5c1 100644 --- a/addon/lib/filter.js +++ b/addon/lib/filter.js @@ -79,6 +79,30 @@ const Providers = { const QualityFilter = { key: 'qualityfilter', options: [ + { + key: 'brremux', + label: 'BluRay REMUX', + test(quality, bingeGroup) { + return bingeGroup && bingeGroup.includes(this.label); + } + }, + { + key: 'hdrall', + label: 'HDR/HRD10+/Dolby Vision', + items: ['HDR', 'HRD10+', 'DV'], + test(quality) { + const hdrProfiles = quality && quality.split(' ').slice(1).join() || ''; + return this.items.some(hdrType => hdrProfiles.includes(hdrType)); + } + }, + { + key: 'dolbyvision', + label: 'Dolby Vision', + test(quality) { + const hdrProfiles = quality && quality.split(' ').slice(1).join() || ''; + return hdrProfiles === 'DV'; + } + }, { key: '4k', label: '4k', @@ -171,7 +195,8 @@ function filterByQuality(streams, config) { const filterOptions = QualityFilter.options.filter(option => filters.includes(option.key)); return streams.filter(stream => { const streamQuality = stream.name.split('\n')[1]; - return !filterOptions.some(option => option.test(streamQuality)); + const bingeGroup = stream.behaviorHints.bingeGroup; + return !filterOptions.some(option => option.test(streamQuality, bingeGroup)); }); }