1
0
Fork 0
mirror of https://github.com/jellyfin/jellyfin-web synced 2025-03-30 19:56:21 +00:00

Add AutoCollection option to libraryoptionseditor

Signed-off-by: Petrus.Z <silencly07@gmail.com>
This commit is contained in:
Petrus.Z 2021-11-17 13:52:54 +08:00
parent 05eeba9012
commit 29483abc62
No known key found for this signature in database
GPG key ID: 71B321E14F898C3D
5 changed files with 21 additions and 0 deletions

View file

@ -410,6 +410,11 @@ import template from './libraryoptionseditor.template.html';
} else {
parent.querySelector('.chkEnableEmbeddedEpisodeInfosContainer').classList.add('hide');
}
if (contentType === 'movies') {
parent.querySelector('.chkAutoCollectionContainer').classList.remove('hide');
} else {
parent.querySelector('.chkAutoCollectionContainer').classList.add('hide');
}
return populateMetadataSettings(parent, contentType);
}
@ -511,6 +516,7 @@ import template from './libraryoptionseditor.template.html';
SkipSubtitlesIfAudioTrackMatches: parent.querySelector('#chkSkipIfAudioTrackPresent').checked,
SaveSubtitlesWithMedia: parent.querySelector('#chkSaveSubtitlesLocally').checked,
RequirePerfectSubtitleMatch: parent.querySelector('#chkRequirePerfectMatch').checked,
AutoCollection: parent.querySelector('#chkAutoCollection').checked,
MetadataSavers: Array.prototype.map.call(Array.prototype.filter.call(parent.querySelectorAll('.chkMetadataSaver'), elem => {
return elem.checked;
}), elem => {
@ -562,6 +568,7 @@ import template from './libraryoptionseditor.template.html';
parent.querySelector('#chkSaveSubtitlesLocally').checked = options.SaveSubtitlesWithMedia;
parent.querySelector('#chkSkipIfAudioTrackPresent').checked = options.SkipSubtitlesIfAudioTrackMatches;
parent.querySelector('#chkRequirePerfectMatch').checked = options.RequirePerfectSubtitleMatch;
parent.querySelector('#chkAutoCollection').checked = options.AutoCollection;
Array.prototype.forEach.call(parent.querySelectorAll('.chkMetadataSaver'), elem => {
elem.checked = options.MetadataSavers ? options.MetadataSavers.includes(elem.getAttribute('data-pluginname')) : elem.getAttribute('data-defaultenabled') === 'true';
});