Excluding others languages during sorting if the checkbox is checked
This commit is contained in:
parent
a83eef99da
commit
c44f5d8fc0
3 changed files with 11 additions and 2 deletions
|
|
@ -286,6 +286,9 @@ export default function landingTemplate(manifest, config = {}) {
|
|||
<select id="iLanguages" class="input" onchange="generateInstallLink()" name="languages[]" multiple="multiple" title="Streams with the selected dubs/subs language will be shown on the top">
|
||||
${languagesOptionsHTML}
|
||||
</select>
|
||||
|
||||
<label class="label" for="iExcludeLanguages">Exclude all other languages</label>
|
||||
<input id="iExcludeLanguages" onchange="generateInstallLink()" type="checkbox">
|
||||
|
||||
<label class="label" for="iQualityFilter">Exclude qualities/resolutions:</label>
|
||||
<select id="iQualityFilter" class="input" onchange="generateInstallLink()" name="qualityFilters[]" multiple="multiple">
|
||||
|
|
@ -431,6 +434,7 @@ export default function landingTemplate(manifest, config = {}) {
|
|||
const qualityFilterValue = $('#iQualityFilter').val().join(',') || '';
|
||||
const sortValue = $('#iSort').val() || '';
|
||||
const languagesValue = $('#iLanguages').val().join(',') || [];
|
||||
const shouldExcludeLanguages = $('#iExcludeLanguages').is(':checked');
|
||||
const limitValue = $('#iLimit').val() || '';
|
||||
const sizeFilterValue = $('#iSizeFilter').val() || '';
|
||||
|
||||
|
|
@ -466,6 +470,7 @@ export default function landingTemplate(manifest, config = {}) {
|
|||
['${Providers.key}', providers],
|
||||
['${SortOptions.key}', sort],
|
||||
['${LanguageOptions.key}', languages],
|
||||
['${ShouldExcludeLanguages.key}', shouldExcludeLanguages]
|
||||
['${QualityFilter.key}', qualityFilters],
|
||||
['limit', limit],
|
||||
['${SizeFilter.key}', sizeFilter],
|
||||
|
|
|
|||
|
|
@ -11,7 +11,7 @@ export function manifest(config = {}) {
|
|||
const overrideManifest = getManifestOverride(config);
|
||||
const baseManifest = {
|
||||
id: 'com.stremio.torrentio.addon',
|
||||
version: '0.0.14',
|
||||
version: '0.0.15',
|
||||
name: getName(overrideManifest, config),
|
||||
description: getDescription(config),
|
||||
catalogs: getCatalogs(config),
|
||||
|
|
|
|||
|
|
@ -39,7 +39,11 @@ export default function sortStreams(streams, config, type) {
|
|||
// No need to filter english since it's hard to predict which entries are english
|
||||
const streamsWithLanguage = streams.filter(stream => containsLanguage(stream, languages));
|
||||
const streamsNoLanguage = streams.filter(stream => !streamsWithLanguage.includes(stream));
|
||||
return _sortStreams(streamsWithLanguage, config, type).concat(_sortStreams(streamsNoLanguage, config, type));
|
||||
const sortedStreams = _sortStreams(streamsWithLanguage, config, type);
|
||||
const shouldExcludeOtherLanguages = config[ShouldExcludeLanguages.key] || false;
|
||||
return shouldExcludeOtherLanguages
|
||||
? sortedStreams
|
||||
: sortedStreams.concat(_sortStreams(streamsNoLanguage, config, type));
|
||||
}
|
||||
return _sortStreams(streams, config, type);
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in a new issue