From 4c168a5ec2156474d47a9fc1d545353cd5e61d36 Mon Sep 17 00:00:00 2001 From: CodeDevMLH <145071728+CodeDevMLH@users.noreply.github.com> Date: Thu, 19 Feb 2026 03:18:39 +0100 Subject: [PATCH] Add Spring, Summer, and Carnival options to plugin configuration and UI --- .../Configuration/PluginConfiguration.cs | 39 +++- .../Configuration/configPage.html | 198 +++++++++++++++++- Jellyfin.Plugin.Seasonals/Web/seasonals.js | 5 + 3 files changed, 235 insertions(+), 7 deletions(-) diff --git a/Jellyfin.Plugin.Seasonals/Configuration/PluginConfiguration.cs b/Jellyfin.Plugin.Seasonals/Configuration/PluginConfiguration.cs index 00b9eac..5bdd2a4 100644 --- a/Jellyfin.Plugin.Seasonals/Configuration/PluginConfiguration.cs +++ b/Jellyfin.Plugin.Seasonals/Configuration/PluginConfiguration.cs @@ -28,6 +28,9 @@ public class PluginConfiguration : BasePluginConfiguration Santa = new SantaOptions(); Easter = new EasterOptions(); Resurrection = new ResurrectionOptions(); + Spring = new SpringOptions(); + Summer = new SummerOptions(); + Carnival = new CarnivalOptions(); } /// @@ -53,7 +56,7 @@ public class PluginConfiguration : BasePluginConfiguration /// /// Gets or sets the seasonal rules configuration as JSON. /// - public string SeasonalRules { get; set; } = "[{\"Name\":\"New Year Fireworks\",\"StartDay\":28,\"StartMonth\":12,\"EndDay\":5,\"EndMonth\":1,\"Theme\":\"fireworks\"},{\"Name\":\"Valentine's Day\",\"StartDay\":10,\"StartMonth\":2,\"EndDay\":18,\"EndMonth\":2,\"Theme\":\"hearts\"},{\"Name\":\"Santa\",\"StartDay\":22,\"StartMonth\":12,\"EndDay\":27,\"EndMonth\":12,\"Theme\":\"santa\"},{\"Name\":\"Snowflakes (December)\",\"StartDay\":1,\"StartMonth\":12,\"EndDay\":31,\"EndMonth\":12,\"Theme\":\"snowflakes\"},{\"Name\":\"Snowfall (January)\",\"StartDay\":1,\"StartMonth\":1,\"EndDay\":31,\"EndMonth\":1,\"Theme\":\"snowfall\"},{\"Name\":\"Snowfall (February)\",\"StartDay\":1,\"StartMonth\":2,\"EndDay\":29,\"EndMonth\":2,\"Theme\":\"snowfall\"},{\"Name\":\"Easter\",\"StartDay\":25,\"StartMonth\":3,\"EndDay\":25,\"EndMonth\":4,\"Theme\":\"easter\"},{\"Name\":\"Halloween\",\"StartDay\":24,\"StartMonth\":10,\"EndDay\":5,\"EndMonth\":11,\"Theme\":\"halloween\"},{\"Name\":\"Autumn\",\"StartDay\":1,\"StartMonth\":9,\"EndDay\":30,\"EndMonth\":11,\"Theme\":\"autumn\"}]"; + public string SeasonalRules { get; set; } = "[{\"Name\":\"New Year Fireworks\",\"StartDay\":28,\"StartMonth\":12,\"EndDay\":5,\"EndMonth\":1,\"Theme\":\"fireworks\"},{\"Name\":\"Carnival\",\"StartDay\":19,\"StartMonth\":2,\"EndDay\":28,\"EndMonth\":2,\"Theme\":\"carnival\"},{\"Name\":\"Valentine's Day\",\"StartDay\":10,\"StartMonth\":2,\"EndDay\":18,\"EndMonth\":2,\"Theme\":\"hearts\"},{\"Name\":\"Spring\",\"StartDay\":1,\"StartMonth\":3,\"EndDay\":31,\"EndMonth\":5,\"Theme\":\"spring\"},{\"Name\":\"Summer\",\"StartDay\":1,\"StartMonth\":6,\"EndDay\":31,\"EndMonth\":8,\"Theme\":\"summer\"},{\"Name\":\"Santa\",\"StartDay\":22,\"StartMonth\":12,\"EndDay\":27,\"EndMonth\":12,\"Theme\":\"santa\"},{\"Name\":\"Snowflakes (December)\",\"StartDay\":1,\"StartMonth\":12,\"EndDay\":31,\"EndMonth\":12,\"Theme\":\"snowflakes\"},{\"Name\":\"Snowfall (January)\",\"StartDay\":1,\"StartMonth\":1,\"EndDay\":31,\"EndMonth\":1,\"Theme\":\"snowfall\"},{\"Name\":\"Snowfall (February)\",\"StartDay\":1,\"StartMonth\":2,\"EndDay\":29,\"EndMonth\":2,\"Theme\":\"snowfall\"},{\"Name\":\"Easter\",\"StartDay\":25,\"StartMonth\":3,\"EndDay\":25,\"EndMonth\":4,\"Theme\":\"easter\"},{\"Name\":\"Halloween\",\"StartDay\":24,\"StartMonth\":10,\"EndDay\":5,\"EndMonth\":11,\"Theme\":\"halloween\"},{\"Name\":\"Autumn\",\"StartDay\":1,\"StartMonth\":9,\"EndDay\":30,\"EndMonth\":11,\"Theme\":\"autumn\"}]"; /// /// Gets or sets the Seasonals options. @@ -69,6 +72,9 @@ public class PluginConfiguration : BasePluginConfiguration public SantaOptions Santa { get; set; } public EasterOptions Easter { get; set; } public ResurrectionOptions Resurrection { get; set; } + public SpringOptions Spring { get; set; } + public SummerOptions Summer { get; set; } + public CarnivalOptions Carnival { get; set; } } public class AutumnOptions @@ -182,3 +188,34 @@ public class ResurrectionOptions public bool EnableRandomSymbolsMobile { get; set; } = false; public bool EnableDifferentDuration { get; set; } = true; } + +public class SpringOptions +{ + public int PetalCount { get; set; } = 25; + public int PollenCount { get; set; } = 15; + public int LadybugCount { get; set; } = 5; + public int SunbeamCount { get; set; } = 5; + public bool EnableSpring { get; set; } = true; + public bool EnableRandomSpring { get; set; } = true; + public bool EnableRandomSpringMobile { get; set; } = false; + public bool EnableDifferentDuration { get; set; } = true; +} + +public class SummerOptions +{ + public int BubbleCount { get; set; } = 20; + public int DustCount { get; set; } = 50; + public bool EnableSummer { get; set; } = true; + public bool EnableRandomSummer { get; set; } = true; + public bool EnableRandomSummerMobile { get; set; } = false; + public bool EnableDifferentDuration { get; set; } = true; +} + +public class CarnivalOptions +{ + public int ObjectCount { get; set; } = 25; + public bool EnableCarnival { get; set; } = true; + public bool EnableRandomCarnival { get; set; } = true; + public bool EnableRandomCarnivalMobile { get; set; } = false; + public bool EnableDifferentDuration { get; set; } = true; +} diff --git a/Jellyfin.Plugin.Seasonals/Configuration/configPage.html b/Jellyfin.Plugin.Seasonals/Configuration/configPage.html index 3d25170..3641951 100644 --- a/Jellyfin.Plugin.Seasonals/Configuration/configPage.html +++ b/Jellyfin.Plugin.Seasonals/Configuration/configPage.html @@ -62,14 +62,13 @@ - - + + - - - - + + + @@ -576,6 +575,140 @@
Randomize the movement speed.
+
+ +
+ Spring +
+ +
Enable the Spring theme in general (e.g. for automation).
+
+
+ +
Displays additional Sakura petals falling across the screen.
+
+
+ +
Displays additional Sakura petals falling across the screen on mobile devices. Warning: High values may affect performance.
+
+
+ + +
Number of additional Sakura petals (if enabled).
+
+
+ + +
Number of pollen particles (if enabled).
+
+
+ + +
Number of ladybugs.
+
+
+ + +
Number of sunbeams (if enabled).
+
+
+ +
Randomize the falling speed of petals.
+
+
+
+ +
+ Summer +
+ +
Enable the Summer theme in general (e.g. for automation).
+
+
+ +
Displays additional bubbles and dust particles rising across the screen.
+
+
+ +
Displays additional bubbles and dust particles rising across the screen on mobile devices. Warning: High values may affect performance.
+
+
+ + +
Number of bubbles (if enabled).
+
+
+ + +
Number of dust particles (if enabled).
+
+
+ +
Randomize the rising speed of bubbles.
+
+
+
+ +
+ Carnival +
+ +
Enable the Carnival theme in general (e.g. for automation).
+
+
+ +
Displays additional confetti falling and fluttering across the screen.
+
+
+ +
Displays additional confetti falling and fluttering across the screen on mobile devices. Warning: High values may affect performance.
+
+
+ + +
Number of additional confetti pieces (if enabled).
+
+
+ +
Randomize the falling speed of confetti.
+
+
@@ -755,6 +888,9 @@ ' ' + ' ' + ' ' + + ' ' + + ' ' + + ' ' + ' ' + '
' + ''; @@ -927,6 +1063,31 @@ document.querySelector('#EnableRandomResurrectionMobile').checked = config.Resurrection.EnableRandomSymbolsMobile; document.querySelector('#EnableDifferentDurationResurrection').checked = config.Resurrection.EnableDifferentDuration; + // Spring + document.querySelector('#EnableSpring').checked = config.Spring.EnableSpring; + document.querySelector('#SpringPetalCount').value = config.Spring.PetalCount; + document.querySelector('#SpringPollenCount').value = config.Spring.PollenCount; + document.querySelector('#SpringLadybugCount').value = config.Spring.LadybugCount; + document.querySelector('#SpringSunbeamCount').value = config.Spring.SunbeamCount; + document.querySelector('#EnableRandomSpring').checked = config.Spring.EnableRandomSpring; + document.querySelector('#EnableRandomSpringMobile').checked = config.Spring.EnableRandomSpringMobile; + document.querySelector('#EnableDifferentDurationSpring').checked = config.Spring.EnableDifferentDuration; + + // Summer + document.querySelector('#EnableSummer').checked = config.Summer.EnableSummer; + document.querySelector('#SummerBubbleCount').value = config.Summer.BubbleCount; + document.querySelector('#SummerDustCount').value = config.Summer.DustCount; + document.querySelector('#EnableRandomSummer').checked = config.Summer.EnableRandomSummer; + document.querySelector('#EnableRandomSummerMobile').checked = config.Summer.EnableRandomSummerMobile; + document.querySelector('#EnableDifferentDurationSummer').checked = config.Summer.EnableDifferentDuration; + + // Carnival + document.querySelector('#EnableCarnival').checked = config.Carnival.EnableCarnival; + document.querySelector('#CarnivalObjectCount').value = config.Carnival.ObjectCount; + document.querySelector('#EnableRandomCarnival').checked = config.Carnival.EnableRandomCarnival; + document.querySelector('#EnableRandomCarnivalMobile').checked = config.Carnival.EnableRandomCarnivalMobile; + document.querySelector('#EnableDifferentDurationCarnival').checked = config.Carnival.EnableDifferentDuration; + Dashboard.hideLoadingMsg(); }); }); @@ -1034,6 +1195,31 @@ config.Resurrection.EnableRandomSymbolsMobile = document.querySelector('#EnableRandomResurrectionMobile').checked; config.Resurrection.EnableDifferentDuration = document.querySelector('#EnableDifferentDurationResurrection').checked; + // Spring + config.Spring.EnableSpring = document.querySelector('#EnableSpring').checked; + config.Spring.PetalCount = parseInt(document.querySelector('#SpringPetalCount').value); + config.Spring.PollenCount = parseInt(document.querySelector('#SpringPollenCount').value); + config.Spring.LadybugCount = parseInt(document.querySelector('#SpringLadybugCount').value); + config.Spring.SunbeamCount = parseInt(document.querySelector('#SpringSunbeamCount').value); + config.Spring.EnableRandomSpring = document.querySelector('#EnableRandomSpring').checked; + config.Spring.EnableRandomSpringMobile = document.querySelector('#EnableRandomSpringMobile').checked; + config.Spring.EnableDifferentDuration = document.querySelector('#EnableDifferentDurationSpring').checked; + + // Summer + config.Summer.EnableSummer = document.querySelector('#EnableSummer').checked; + config.Summer.BubbleCount = parseInt(document.querySelector('#SummerBubbleCount').value); + config.Summer.DustCount = parseInt(document.querySelector('#SummerDustCount').value); + config.Summer.EnableRandomSummer = document.querySelector('#EnableRandomSummer').checked; + config.Summer.EnableRandomSummerMobile = document.querySelector('#EnableRandomSummerMobile').checked; + config.Summer.EnableDifferentDuration = document.querySelector('#EnableDifferentDurationSummer').checked; + + // Carnival + config.Carnival.EnableCarnival = document.querySelector('#EnableCarnival').checked; + config.Carnival.ObjectCount = parseInt(document.querySelector('#CarnivalObjectCount').value); + config.Carnival.EnableRandomCarnival = document.querySelector('#EnableRandomCarnival').checked; + config.Carnival.EnableRandomCarnivalMobile = document.querySelector('#EnableRandomCarnivalMobile').checked; + config.Carnival.EnableDifferentDuration = document.querySelector('#EnableDifferentDurationCarnival').checked; + ApiClient.updatePluginConfiguration(SeasonalsConfigPage.pluginUniqueId, config).then(function (result) { Dashboard.processPluginConfigurationUpdateResult(result); }); diff --git a/Jellyfin.Plugin.Seasonals/Web/seasonals.js b/Jellyfin.Plugin.Seasonals/Web/seasonals.js index ce9f73a..77485d0 100644 --- a/Jellyfin.Plugin.Seasonals/Web/seasonals.js +++ b/Jellyfin.Plugin.Seasonals/Web/seasonals.js @@ -68,6 +68,11 @@ const ThemeConfigs = { js: '../Seasonals/Resources/spring.js', containerClass: 'spring-container' }, + carnival: { + css: '../Seasonals/Resources/carnival.css', + js: '../Seasonals/Resources/carnival.js', + containerClass: 'carnival-container' + }, none: { containerClass: 'none' },