Add option to enable/disable libraries

This commit adds the option to enable/disable libraries from the library
options editor. The backend changes required for this functionality are
in jellyfin PR 11037.

This commit adds a checkbox in the library options editor. It adds a
checkbox saying "Library Enabled" that is checked by default.

libraryoptionseditor.js - added logic to handle enable libraries
checkbox. Enables libraries by default
libraryoptionseditor.template.html - added "enable libraries" checkbox
src/strings/en-us.json - added English strings for enable library
checkbox.
This commit is contained in:
Topher Johnson 2024-02-19 23:37:46 -08:00
parent 6c8967110e
commit 60fc2c72b2
4 changed files with 13 additions and 0 deletions

View File

@ -79,6 +79,7 @@
- [Kevin Tan (Valius)](https://github.com/valius)
- [Rasmus Krämer](https://github.com/rasmuslos)
- [ntarelix](https://github.com/ntarelix)
- [btopherjohnson](https://github.com/btopherjohnson)
## Emby Contributors

View File

@ -511,6 +511,7 @@ function setImageOptionsIntoOptions(options) {
export function getLibraryOptions(parent) {
const options = {
Disabled: !parent.querySelector('.chkEnabled').checked,
EnableArchiveMediaFiles: false,
EnablePhotos: parent.querySelector('.chkEnablePhotos').checked,
EnableRealtimeMonitor: parent.querySelector('.chkEnableRealtimeMonitor').checked,
@ -574,6 +575,7 @@ export function setLibraryOptions(parent, options) {
parent.querySelector('#selectCountry').value = options.MetadataCountryCode || '';
parent.querySelector('#selectAutoRefreshInterval').value = options.AutomaticRefreshIntervalDays || '0';
parent.querySelector('#txtSeasonZeroName').value = options.SeasonZeroDisplayName || 'Specials';
parent.querySelector('.chkEnabled').checked = !options.Disabled;
parent.querySelector('.chkEnablePhotos').checked = options.EnablePhotos;
parent.querySelector('.chkEnableRealtimeMonitor').checked = options.EnableRealtimeMonitor;
parent.querySelector('.chkEnableLUFSScan').checked = options.EnableLUFSScan;

View File

@ -1,4 +1,12 @@
<h2>${HeaderLibrarySettings}</h2>
<div class="checkboxContainer checkboxContainer-withDescription chkEnable">
<label>
<input type="checkbox" is="emby-checkbox" class="chkEnabled" checked />
<span>${EnableLibrary}</span>
</label>
<div class="fieldDescription checkboxFieldDescription">${EnableLibraryHelp}</div>
</div>
<div class="selectContainer fldMetadataLanguage hide">
<select is="emby-select" id="selectLanguage" label="${LabelMetadataDownloadLanguage}"></select>
</div>

View File

@ -237,6 +237,8 @@
"EnableFasterAnimations": "Faster animations",
"EnableFasterAnimationsHelp": "Use faster animations and transitions.",
"EnableHardwareEncoding": "Enable hardware encoding",
"EnableLibrary": "Enable the library",
"EnableLibraryHelp": "Allows the library to be enabled/disabled",
"EnableNextVideoInfoOverlay": "Show next video info during playback",
"EnableNextVideoInfoOverlayHelp": "At the end of a video, display info about the next video coming up in the current playlist.",
"EnablePhotos": "Display the photos",