exclude english from language filter
This commit is contained in:
@@ -282,7 +282,7 @@ function landingTemplate(manifest, config = {}) {
|
||||
${sortOptionsHTML}
|
||||
</select>
|
||||
|
||||
<label class="label" for="iLanguage">Priority language:</label>
|
||||
<label class="label" for="iLanguage">Priority foreign language:</label>
|
||||
<select id="iLanguage" class="input" onchange="generateInstallLink()" title="Streams with the selected dubs/subs language will be shown on the top">
|
||||
<option value="none" selected>None</option>
|
||||
${languageOptionsHTML}
|
||||
|
||||
@@ -31,15 +31,16 @@ const SortOptions = {
|
||||
}
|
||||
const LanguageOptions = {
|
||||
key: 'language',
|
||||
options: languages.map(lang => ({
|
||||
options: languages.slice(1).map(lang => ({
|
||||
key: lang,
|
||||
label: lang.charAt(0).toUpperCase() + lang.substr(1)
|
||||
label: lang.charAt(0).toUpperCase() + lang.slice(1)
|
||||
}))
|
||||
}
|
||||
|
||||
function sortStreams(streams, config) {
|
||||
const language = config[LanguageOptions.key];
|
||||
if (language) {
|
||||
if (language && language !== languages[0]) {
|
||||
// No need to filter english since it's hard to predict which entries are english
|
||||
const streamsWithLanguage = streams.filter(stream => containsLanguage(stream, language));
|
||||
const streamsNoLanguage = streams.filter(stream => !streamsWithLanguage.includes(stream));
|
||||
return _sortStreams(streamsWithLanguage, config).concat(_sortStreams(streamsNoLanguage, config));
|
||||
|
||||
Reference in New Issue
Block a user