From b613b028d055daa5f99fc17addffd65e41879cc4 Mon Sep 17 00:00:00 2001
From: CodeDevMLH <145071728+CodeDevMLH@users.noreply.github.com>
Date: Fri, 13 Feb 2026 00:50:34 +0100
Subject: [PATCH] Add configuration options for custom ID limits
---
.../Configuration/PluginConfiguration.cs | 1 +
.../Configuration/configPage.html | 13 ++++++-------
.../Web/mediaBarEnhanced.js | 14 ++++++++------
3 files changed, 15 insertions(+), 13 deletions(-)
diff --git a/Jellyfin.Plugin.MediaBarEnhanced/Configuration/PluginConfiguration.cs b/Jellyfin.Plugin.MediaBarEnhanced/Configuration/PluginConfiguration.cs
index 725c5c2..2364819 100644
--- a/Jellyfin.Plugin.MediaBarEnhanced/Configuration/PluginConfiguration.cs
+++ b/Jellyfin.Plugin.MediaBarEnhanced/Configuration/PluginConfiguration.cs
@@ -36,6 +36,7 @@ namespace Jellyfin.Plugin.MediaBarEnhanced.Configuration
public bool EnableSeasonalContent { get; set; } = false;
public bool IsEnabled { get; set; } = true;
public bool EnableClientSideSettings { get; set; } = false;
+ public bool ApplyLimitsToCustomIds { get; set; } = false;
public string SortBy { get; set; } = "Random";
public string SortOrder { get; set; } = "Ascending";
}
diff --git a/Jellyfin.Plugin.MediaBarEnhanced/Configuration/configPage.html b/Jellyfin.Plugin.MediaBarEnhanced/Configuration/configPage.html
index 73e3f20..108d101 100644
--- a/Jellyfin.Plugin.MediaBarEnhanced/Configuration/configPage.html
+++ b/Jellyfin.Plugin.MediaBarEnhanced/Configuration/configPage.html
@@ -107,12 +107,11 @@
Media/Collection/Playlist
@@ -411,7 +410,7 @@
'ShowTrailerButton', 'AlwaysShowArrows', 'EnableKeyboardControls',
'EnableCustomMediaIds', 'CustomMediaIds', 'EnableLoadingScreen',
'EnableSeasonalContent', 'EnableClientSideSettings', 'SortBy', 'SortOrder',
- 'PreferLocalTrailers'
+ 'PreferLocalTrailers', 'ApplyLimitsToCustomIds', 'SeasonalSections'
];
keys.forEach(function (key) {
@@ -478,7 +477,7 @@
'ShowTrailerButton', 'AlwaysShowArrows', 'EnableKeyboardControls',
'EnableCustomMediaIds', 'CustomMediaIds', 'EnableLoadingScreen',
'EnableSeasonalContent', 'EnableClientSideSettings', 'SortBy', 'SortOrder',
- 'PreferLocalTrailers'
+ 'PreferLocalTrailers', 'ApplyLimitsToCustomIds', 'SeasonalSections'
];
keys.forEach(function (key) {
diff --git a/Jellyfin.Plugin.MediaBarEnhanced/Web/mediaBarEnhanced.js b/Jellyfin.Plugin.MediaBarEnhanced/Web/mediaBarEnhanced.js
index 5cb6bc0..c6ee6e3 100644
--- a/Jellyfin.Plugin.MediaBarEnhanced/Web/mediaBarEnhanced.js
+++ b/Jellyfin.Plugin.MediaBarEnhanced/Web/mediaBarEnhanced.js
@@ -57,6 +57,8 @@ const CONFIG = {
enableClientSideSettings: false,
sortBy: "Random",
sortOrder: "Ascending",
+ applyLimitsToCustomIds: false,
+ seasonalSections: "[]",
};
// State management
@@ -1781,11 +1783,7 @@ const SlideCreator = {
},
'onStateChange': (event) => {
if (event.data === YT.PlayerState.ENDED) {
- if (CONFIG.waitForTrailerToEnd) {
SlideshowManager.nextSlide();
- } else {
- event.target.playVideo(); // Loop if not waiting for end if trailer is shorter than slide duration
- }
}
},
'onError': (event) => {
@@ -1843,9 +1841,7 @@ const SlideCreator = {
});
backdrop.addEventListener('ended', () => {
- if (CONFIG.waitForTrailerToEnd) {
SlideshowManager.nextSlide();
- }
});
backdrop.addEventListener('error', () => {
@@ -3137,6 +3133,12 @@ const SlideshowManager = {
console.log("Using Custom Media IDs from configuration");
const rawIds = this.parseCustomIds();
itemIds = await this.resolveCollectionsAndItems(rawIds);
+
+ // Apply max items limit to custom IDs if enabled
+ if (CONFIG.applyLimitsToCustomIds && itemIds.length > CONFIG.maxItems) {
+ console.log(`Limiting custom IDs from ${itemIds.length} to ${CONFIG.maxItems}`);
+ itemIds = itemIds.slice(0, CONFIG.maxItems);
+ }
}
// 2. Try Avatar List (list.txt)