diff --git a/Jellyfin.Plugin.MediaBarEnhanced/Configuration/PluginConfiguration.cs b/Jellyfin.Plugin.MediaBarEnhanced/Configuration/PluginConfiguration.cs
index 162a05a..a4a631c 100644
--- a/Jellyfin.Plugin.MediaBarEnhanced/Configuration/PluginConfiguration.cs
+++ b/Jellyfin.Plugin.MediaBarEnhanced/Configuration/PluginConfiguration.cs
@@ -35,5 +35,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 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 76c8f94..d4e298d 100644
--- a/Jellyfin.Plugin.MediaBarEnhanced/Configuration/configPage.html
+++ b/Jellyfin.Plugin.MediaBarEnhanced/Configuration/configPage.html
@@ -274,6 +274,32 @@
mobile).
+
Content Sorting
+
+
+
+
Sort items by the selected criteria.
+
+
+
+
+
Sort items in Ascending or Descending order.
+
+
+ Note: Sorting settings apply to both Server content and Custom IDs. 'Original' preserves Custom List order.
+
+
Content Limits
Leave a setting blank to use the default value.
@@ -370,7 +396,7 @@
'WaitForTrailerToEnd', 'StartMuted', 'FullWidthVideo', 'EnableMobileVideo',
'ShowTrailerButton', 'AlwaysShowArrows', 'EnableKeyboardControls',
'EnableCustomMediaIds', 'CustomMediaIds', 'EnableLoadingScreen',
- 'EnableSeasonalContent', 'EnableClientSideSettings'
+ 'EnableSeasonalContent', 'EnableClientSideSettings', 'SortBy', 'SortOrder'
];
keys.forEach(function (key) {
@@ -419,7 +445,7 @@
'WaitForTrailerToEnd', 'StartMuted', 'FullWidthVideo', 'EnableMobileVideo',
'ShowTrailerButton', 'AlwaysShowArrows', 'EnableKeyboardControls',
'EnableCustomMediaIds', 'CustomMediaIds', 'EnableLoadingScreen',
- 'EnableSeasonalContent', 'EnableClientSideSettings'
+ 'EnableSeasonalContent', 'EnableClientSideSettings', 'SortBy', 'SortOrder'
];
keys.forEach(function (key) {
diff --git a/Jellyfin.Plugin.MediaBarEnhanced/Web/mediaBarEnhanced.js b/Jellyfin.Plugin.MediaBarEnhanced/Web/mediaBarEnhanced.js
index 423d1c0..68adc20 100644
--- a/Jellyfin.Plugin.MediaBarEnhanced/Web/mediaBarEnhanced.js
+++ b/Jellyfin.Plugin.MediaBarEnhanced/Web/mediaBarEnhanced.js
@@ -51,6 +51,8 @@ const CONFIG = {
customMediaIds: "",
enableLoadingScreen: true,
enableClientSideSettings: false,
+ sortBy: "Random",
+ sortOrder: "Ascending",
};
// State management
@@ -460,6 +462,62 @@ waitForApiClientAndInitialize();
* Utility functions for slide creation and management
*/
const SlideUtils = {
+ /**
+ * Sorts items based on configuration
+ * @param {Array