mirror of
https://github.com/jellyfin/jellyfin-web
synced 2025-03-30 19:56:21 +00:00
Merge 73baf3b92a
into 7d84185d0e
This commit is contained in:
commit
e6f6042559
3 changed files with 51 additions and 1 deletions
|
@ -57,6 +57,14 @@ function renderFilters(context, result, query) {
|
||||||
const delimeter = ',';
|
const delimeter = ',';
|
||||||
return (delimeter + (query.Years || '') + delimeter).includes(delimeter + i + delimeter);
|
return (delimeter + (query.Years || '') + delimeter).includes(delimeter + i + delimeter);
|
||||||
});
|
});
|
||||||
|
renderOptions(context, '.audioLanguageFilters', 'chkAudioLanguageFilter', result.AudioLanguages, function (i) {
|
||||||
|
const delimeter = ',';
|
||||||
|
return (delimeter + (query.AudioLanguages || '') + delimeter).includes(delimeter + i + delimeter);
|
||||||
|
});
|
||||||
|
renderOptions(context, '.subtitleLanguageFilters', 'chkSubtitleLanguageFilter', result.SubtitleLanguages, function (i) {
|
||||||
|
const delimeter = ',';
|
||||||
|
return (delimeter + (query.SubtitleLanguages || '') + delimeter).includes(delimeter + i + delimeter);
|
||||||
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
function loadDynamicFilters(context, apiClient, userId, itemQuery) {
|
function loadDynamicFilters(context, apiClient, userId, itemQuery) {
|
||||||
|
@ -121,6 +129,7 @@ function triggerChange(instance) {
|
||||||
function setVisibility(context, options) {
|
function setVisibility(context, options) {
|
||||||
if (options.mode === 'livetvchannels' || options.mode === 'albums' || options.mode === 'artists' || options.mode === 'albumartists' || options.mode === 'songs') {
|
if (options.mode === 'livetvchannels' || options.mode === 'albums' || options.mode === 'artists' || options.mode === 'albumartists' || options.mode === 'songs') {
|
||||||
hideByClass(context, 'videoStandard');
|
hideByClass(context, 'videoStandard');
|
||||||
|
hideByClass(context, 'languageFilters');
|
||||||
}
|
}
|
||||||
|
|
||||||
if (enableDynamicFilters(options.mode)) {
|
if (enableDynamicFilters(options.mode)) {
|
||||||
|
@ -136,6 +145,7 @@ function setVisibility(context, options) {
|
||||||
|
|
||||||
if (options.mode === 'movies' || options.mode === 'series' || options.mode === 'episodes') {
|
if (options.mode === 'movies' || options.mode === 'series' || options.mode === 'episodes') {
|
||||||
context.querySelector('.features').classList.remove('hide');
|
context.querySelector('.features').classList.remove('hide');
|
||||||
|
context.querySelector('.languageFilters').classList.remove('hide');
|
||||||
}
|
}
|
||||||
|
|
||||||
if (options.mode === 'series') {
|
if (options.mode === 'series') {
|
||||||
|
@ -400,6 +410,34 @@ class FilterDialog {
|
||||||
query.StartIndex = 0;
|
query.StartIndex = 0;
|
||||||
query.OfficialRatings = filters;
|
query.OfficialRatings = filters;
|
||||||
triggerChange(this);
|
triggerChange(this);
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
const chkAudioLanguageFilter = dom.parentWithClass(e.target, 'chkAudioLanguageFilter');
|
||||||
|
if (chkAudioLanguageFilter) {
|
||||||
|
const filterName = chkAudioLanguageFilter.getAttribute('data-filter');
|
||||||
|
let filters = query.AudioLanguages || '';
|
||||||
|
const delimiter = ',';
|
||||||
|
filters = (delimiter + filters).replace(delimiter + filterName, '').substring(1);
|
||||||
|
if (chkAudioLanguageFilter.checked) {
|
||||||
|
filters = filters ? (filters + delimiter + filterName) : filterName;
|
||||||
|
}
|
||||||
|
query.StartIndex = 0;
|
||||||
|
query.AudioLanguages = filters;
|
||||||
|
triggerChange(this);
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
const chkSubtitleLanguageFilter = dom.parentWithClass(e.target, 'chkSubtitleLanguageFilter');
|
||||||
|
if (chkSubtitleLanguageFilter) {
|
||||||
|
const filterName = chkSubtitleLanguageFilter.getAttribute('data-filter');
|
||||||
|
let filters = query.SubtitleLanguages || '';
|
||||||
|
const delimiter = ',';
|
||||||
|
filters = (delimiter + filters).replace(delimiter + filterName, '').substring(1);
|
||||||
|
if (chkSubtitleLanguageFilter.checked) {
|
||||||
|
filters = filters ? (filters + delimiter + filterName) : filterName;
|
||||||
|
}
|
||||||
|
query.StartIndex = 0;
|
||||||
|
query.SubtitleLanguages = filters;
|
||||||
|
triggerChange(this);
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
|
@ -140,4 +140,14 @@
|
||||||
<div class="collapseContent filterOptions">
|
<div class="collapseContent filterOptions">
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
|
<div is="emby-collapse" title="${AudioLanguages}" class="audioLanguageFilters languageFilters hide">
|
||||||
|
<div class="collapseContent filterOptions">
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<div is="emby-collapse" title="${SubtitleLanguages}" class="subtitleLanguageFilters languageFilters hide">
|
||||||
|
<div class="collapseContent filterOptions">
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
|
@ -1819,5 +1819,7 @@
|
||||||
"ExtractTrickplayImagesHelp": "Trickplay images are similar to chapter images, except they span the entire length of the content and are used to show a preview when scrubbing through videos.",
|
"ExtractTrickplayImagesHelp": "Trickplay images are similar to chapter images, except they span the entire length of the content and are used to show a preview when scrubbing through videos.",
|
||||||
"LabelExtractTrickplayDuringLibraryScan": "Extract trickplay images during the library scan",
|
"LabelExtractTrickplayDuringLibraryScan": "Extract trickplay images during the library scan",
|
||||||
"LabelExtractTrickplayDuringLibraryScanHelp": "Generate trickplay images when videos are imported during the library scan. Otherwise, they will be extracted during the trickplay images scheduled task. If generation is set to non-blocking this will not affect the time a library scan takes to complete.",
|
"LabelExtractTrickplayDuringLibraryScanHelp": "Generate trickplay images when videos are imported during the library scan. Otherwise, they will be extracted during the trickplay images scheduled task. If generation is set to non-blocking this will not affect the time a library scan takes to complete.",
|
||||||
"LogLoadFailure": "Failed to load the log file. It may still be actively written to."
|
"LogLoadFailure": "Failed to load the log file. It may still be actively written to.",
|
||||||
|
"AudioLanguages": "Audio languages",
|
||||||
|
"SubtitleLanguages": "Subtitle languages"
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue