- Enter the names of libraries to analyze, separated by commas. If this field is left
- blank, all libraries on the server containing television episodes will be analyzed.
+
+
+
Limit analysis to the following libraries
+
+
+
+ Select the libraries you want to include in the analysis. If no libraries are selected, all TV show libraries will be analyzed.
+
+
+
@@ -401,7 +403,7 @@
Auto Skip Client List
-
+
@@ -810,41 +812,43 @@
}
}
- async function getDeviceList() {
- const response = await getJson("Devices");
- const devices = [...new Set(response.Items.map(item => item.AppName))];
- return devices;
+ function updateList(textField, container) {
+ textField.value = Array.from(container.querySelectorAll('input[type="checkbox"]:checked'))
+ .map(checkbox => checkbox.nextElementSibling.textContent)
+ .join(', ');
}
- function updateClientList() {
- document.getElementById('ClientList').value = Array.from(
- autoSkipClientList.querySelectorAll('input[type="checkbox"]:checked')
- ).map(checkbox => checkbox.nextElementSibling.textContent).join(', ');
- }
+ function generateCheckboxList(items, containerId, textFieldId) {
+ const container = document.getElementById(containerId);
+ const textField = document.getElementById(textFieldId);
+ const checkedItems = textField.value ? textField.value.split(', ') : [];
- async function generateAutoSkipClientList() {
- var devices = await getDeviceList();
- var deviceList = document.getElementById('ClientList').value;
- var checkedDevices = deviceList ? deviceList.split(', ') : [];
-
- var checkboxListHtml = devices.map(function(device) {
- var id = 'chk' + device.replace(/\s+/g, '');
- var isChecked = checkedDevices.includes(device) ? 'checked' : '';
+ container.innerHTML = items.map(item => {
+ const isChecked = checkedItems.includes(item) ? 'checked' : '';
return '' +
- ' ' +
- '' + device + ' ' +
+ ' ' +
+ '' + item + ' ' +
' ';
}).join('');
- var checkboxList = autoSkipClientList.querySelector('.checkboxList.paperList');
- checkboxList.innerHTML = checkboxListHtml;
+ container.addEventListener('change', event => {
+ if (event.target.type === 'checkbox') {
+ updateList(textField, container);
+ }
+ });
+ }
- var checkboxes = checkboxList.querySelectorAll('input[type="checkbox"]');
- for (var i = 0; i < checkboxes.length; i++) {
- checkboxes[i].addEventListener('change', function() {
- updateClientList();
- });
- }
+ async function generateAutoSkipClientList() {
+ const response = await getJson("Devices");
+ const devices = [...new Set(response.Items.map(item => item.AppName))];
+ generateCheckboxList(devices, 'autoSkipCheckboxes', 'ClientList');
+ }
+
+ async function populateLibraries() {
+ const response = await getJson("Library/MediaFolders");
+ const tvLibraries = response.Items.filter(item => item.CollectionType === "tvshows");
+ const libraryNames = tvLibraries.map(lib => lib.Name || 'Unnamed Library');
+ generateCheckboxList(libraryNames, 'libraryCheckboxes', 'SelectedLibraries');
}
var persistSkip = document.querySelector("input#PersistSkipButton");
@@ -1197,6 +1201,7 @@
document.querySelector("#" + field).checked = config[field];
}
+ populateLibraries();
autoSkipChanged();
autoSkipCreditsChanged();
persistSkipChanged();