Skip to content

Commit

Permalink
Backport pull request #5810 from jellyfin-web/release-10.9.z
Browse files Browse the repository at this point in the history
Fix chapter type options not showing for mixed libraries

Original-merge: c98822a

Merged-by: thornbill <thornbill@users.noreply.github.com>

Backported-by: Bill Thornton <thornbill@users.noreply.github.com>
  • Loading branch information
thornbill committed Jul 21, 2024
1 parent 0084cc8 commit 0090ccd
Showing 1 changed file with 16 additions and 11 deletions.
27 changes: 16 additions & 11 deletions src/components/libraryoptionseditor/libraryoptionseditor.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,9 @@
* @module components/libraryoptionseditor/libraryoptionseditor
*/

import { CollectionType } from '@jellyfin/sdk/lib/generated-client/models/collection-type';
import escapeHtml from 'escape-html';

import globalize from '../../scripts/globalize';
import dom from '../../scripts/dom';
import '../../elements/emby-checkbox/emby-checkbox';
Expand Down Expand Up @@ -383,20 +385,23 @@ export async function embed(parent, contentType, libraryOptions) {
});
}

const CHAPTER_CONTENT_TYPES = [
CollectionType.Homevideos,
CollectionType.Movies,
CollectionType.Musicvideos,
CollectionType.Tvshows
];

export function setContentType(parent, contentType) {
if (contentType === 'homevideos' || contentType === 'photos') {
parent.querySelector('.chkEnablePhotosContainer').classList.remove('hide');
} else {
parent.querySelector('.chkEnablePhotosContainer').classList.add('hide');
}

if (contentType !== 'tvshows' && contentType !== 'movies' && contentType !== 'homevideos' && contentType !== 'musicvideos' && contentType !== 'mixed') {
parent.querySelector('.trickplaySettingsSection').classList.add('hide');
parent.querySelector('.chapterSettingsSection').classList.add('hide');
} else {
parent.querySelector('.trickplaySettingsSection').classList.remove('hide');
parent.querySelector('.chapterSettingsSection').classList.remove('hide');
}
const hasChapterOptions = !contentType /* Mixed */ || CHAPTER_CONTENT_TYPES.includes(contentType);
parent.querySelector('.trickplaySettingsSection').classList.toggle('hide', !hasChapterOptions);
parent.querySelector('.chapterSettingsSection').classList.toggle('hide', !hasChapterOptions);

if (contentType === 'tvshows') {
parent.querySelector('.chkAutomaticallyGroupSeriesContainer').classList.remove('hide');
Expand Down Expand Up @@ -623,8 +628,8 @@ let currentLibraryOptions;
let currentAvailableOptions;

export default {
embed: embed,
setContentType: setContentType,
getLibraryOptions: getLibraryOptions,
setLibraryOptions: setLibraryOptions
embed,
setContentType,
getLibraryOptions,
setLibraryOptions
};

0 comments on commit 0090ccd

Please sign in to comment.