mirror of
https://github.com/jellyfin/jellyfin-web
synced 2025-03-30 19:56:21 +00:00
Backport pull request #5810 from jellyfin-web/release-10.9.z
Fix chapter type options not showing for mixed libraries
Original-merge: c98822a7c6
Merged-by: thornbill <thornbill@users.noreply.github.com>
Backported-by: Bill Thornton <thornbill@users.noreply.github.com>
This commit is contained in:
parent
0084cc856e
commit
0090ccd893
1 changed files with 16 additions and 11 deletions
|
@ -4,7 +4,9 @@
|
||||||
* @module components/libraryoptionseditor/libraryoptionseditor
|
* @module components/libraryoptionseditor/libraryoptionseditor
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
import { CollectionType } from '@jellyfin/sdk/lib/generated-client/models/collection-type';
|
||||||
import escapeHtml from 'escape-html';
|
import escapeHtml from 'escape-html';
|
||||||
|
|
||||||
import globalize from '../../scripts/globalize';
|
import globalize from '../../scripts/globalize';
|
||||||
import dom from '../../scripts/dom';
|
import dom from '../../scripts/dom';
|
||||||
import '../../elements/emby-checkbox/emby-checkbox';
|
import '../../elements/emby-checkbox/emby-checkbox';
|
||||||
|
@ -383,6 +385,13 @@ export async function embed(parent, contentType, libraryOptions) {
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
const CHAPTER_CONTENT_TYPES = [
|
||||||
|
CollectionType.Homevideos,
|
||||||
|
CollectionType.Movies,
|
||||||
|
CollectionType.Musicvideos,
|
||||||
|
CollectionType.Tvshows
|
||||||
|
];
|
||||||
|
|
||||||
export function setContentType(parent, contentType) {
|
export function setContentType(parent, contentType) {
|
||||||
if (contentType === 'homevideos' || contentType === 'photos') {
|
if (contentType === 'homevideos' || contentType === 'photos') {
|
||||||
parent.querySelector('.chkEnablePhotosContainer').classList.remove('hide');
|
parent.querySelector('.chkEnablePhotosContainer').classList.remove('hide');
|
||||||
|
@ -390,13 +399,9 @@ export function setContentType(parent, contentType) {
|
||||||
parent.querySelector('.chkEnablePhotosContainer').classList.add('hide');
|
parent.querySelector('.chkEnablePhotosContainer').classList.add('hide');
|
||||||
}
|
}
|
||||||
|
|
||||||
if (contentType !== 'tvshows' && contentType !== 'movies' && contentType !== 'homevideos' && contentType !== 'musicvideos' && contentType !== 'mixed') {
|
const hasChapterOptions = !contentType /* Mixed */ || CHAPTER_CONTENT_TYPES.includes(contentType);
|
||||||
parent.querySelector('.trickplaySettingsSection').classList.add('hide');
|
parent.querySelector('.trickplaySettingsSection').classList.toggle('hide', !hasChapterOptions);
|
||||||
parent.querySelector('.chapterSettingsSection').classList.add('hide');
|
parent.querySelector('.chapterSettingsSection').classList.toggle('hide', !hasChapterOptions);
|
||||||
} else {
|
|
||||||
parent.querySelector('.trickplaySettingsSection').classList.remove('hide');
|
|
||||||
parent.querySelector('.chapterSettingsSection').classList.remove('hide');
|
|
||||||
}
|
|
||||||
|
|
||||||
if (contentType === 'tvshows') {
|
if (contentType === 'tvshows') {
|
||||||
parent.querySelector('.chkAutomaticallyGroupSeriesContainer').classList.remove('hide');
|
parent.querySelector('.chkAutomaticallyGroupSeriesContainer').classList.remove('hide');
|
||||||
|
@ -623,8 +628,8 @@ let currentLibraryOptions;
|
||||||
let currentAvailableOptions;
|
let currentAvailableOptions;
|
||||||
|
|
||||||
export default {
|
export default {
|
||||||
embed: embed,
|
embed,
|
||||||
setContentType: setContentType,
|
setContentType,
|
||||||
getLibraryOptions: getLibraryOptions,
|
getLibraryOptions,
|
||||||
setLibraryOptions: setLibraryOptions
|
setLibraryOptions
|
||||||
};
|
};
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue