From 176aa97c1c12244738318633fb36502492cb1171 Mon Sep 17 00:00:00 2001 From: CodeDevMLH <145071728+CodeDevMLH@users.noreply.github.com> Date: Thu, 18 Dec 2025 00:01:19 +0100 Subject: [PATCH] feat: update configuration keys to use PascalCase for consistency across seasonal scripts --- Jellyfin.Plugin.Seasonals/ScriptInjector.cs | 2 +- Jellyfin.Plugin.Seasonals/Web/autumn.js | 14 ++++++------- Jellyfin.Plugin.Seasonals/Web/christmas.js | 12 +++++------ Jellyfin.Plugin.Seasonals/Web/easter.js | 22 ++++++++++----------- Jellyfin.Plugin.Seasonals/Web/fireworks.js | 14 ++++++------- Jellyfin.Plugin.Seasonals/Web/halloween.js | 12 +++++------ Jellyfin.Plugin.Seasonals/Web/hearts.js | 12 +++++------ Jellyfin.Plugin.Seasonals/Web/santa.js | 22 ++++++++++----------- Jellyfin.Plugin.Seasonals/Web/seasonals.js | 1 - Jellyfin.Plugin.Seasonals/Web/snowfall.js | 10 +++++----- Jellyfin.Plugin.Seasonals/Web/snowflakes.js | 14 ++++++------- Jellyfin.Plugin.Seasonals/Web/snowstorm.js | 14 ++++++------- 12 files changed, 74 insertions(+), 75 deletions(-) diff --git a/Jellyfin.Plugin.Seasonals/ScriptInjector.cs b/Jellyfin.Plugin.Seasonals/ScriptInjector.cs index 6432b26..b926844 100644 --- a/Jellyfin.Plugin.Seasonals/ScriptInjector.cs +++ b/Jellyfin.Plugin.Seasonals/ScriptInjector.cs @@ -70,7 +70,7 @@ public class ScriptInjector } catch (UnauthorizedAccessException) { - _logger.LogWarning("Permission denied when attempting to inject script into index.html. Automatic injection failed. Please ensure the Jellyfin web directory is writable by the process, or manually add the script tag: {ScriptTag}", ScriptTag); + _logger.LogWarning("Access was denied when attempting to inject script into index.html. Automatic injection failed. Please ensure the Jellyfin web directory is writable by the process, or manually add the script tag: {ScriptTag}", ScriptTag); return false; } catch (Exception ex) diff --git a/Jellyfin.Plugin.Seasonals/Web/autumn.js b/Jellyfin.Plugin.Seasonals/Web/autumn.js index 4ee0e11..b7a3eaa 100644 --- a/Jellyfin.Plugin.Seasonals/Web/autumn.js +++ b/Jellyfin.Plugin.Seasonals/Web/autumn.js @@ -1,11 +1,11 @@ -const config = window.SeasonalsPluginConfig?.autumn || {}; +const config = window.SeasonalsPluginConfig?.Autumn || {}; -const leaves = config.enableAutumn !== undefined ? config.enableAutumn : true; // enable/disable leaves -const randomLeaves = config.enableRandomLeaves !== undefined ? config.enableRandomLeaves : true; // enable random leaves -const randomLeavesMobile = config.enableRandomLeavesMobile !== undefined ? config.enableRandomLeavesMobile : false; // enable random leaves on mobile devices (Warning: High values may affect performance) -const enableDiffrentDuration = config.enableDifferentDuration !== undefined ? config.enableDifferentDuration : true; // enable different duration for the random leaves -const enableRotation = config.enableRotation !== undefined ? config.enableRotation : false; // enable/disable leaf rotation -const leafCount = config.leafCount || 25; // count of random extra leaves +const leaves = config.EnableAutumn !== undefined ? config.EnableAutumn : true; // enable/disable leaves +const randomLeaves = config.EnableRandomLeaves !== undefined ? config.EnableRandomLeaves : true; // enable random leaves +const randomLeavesMobile = config.EnableRandomLeavesMobile !== undefined ? config.EnableRandomLeavesMobile : false; // enable random leaves on mobile devices (Warning: High values may affect performance) +const enableDiffrentDuration = config.EnableDifferentDuration !== undefined ? config.EnableDifferentDuration : true; // enable different duration for the random leaves +const enableRotation = config.EnableRotation !== undefined ? config.EnableRotation : false; // enable/disable leaf rotation +const leafCount = config.LeafCount || 25; // count of random extra leaves let msgPrinted = false; // flag to prevent multiple console messages diff --git a/Jellyfin.Plugin.Seasonals/Web/christmas.js b/Jellyfin.Plugin.Seasonals/Web/christmas.js index 5286e9a..079e8a5 100644 --- a/Jellyfin.Plugin.Seasonals/Web/christmas.js +++ b/Jellyfin.Plugin.Seasonals/Web/christmas.js @@ -1,10 +1,10 @@ -const config = window.SeasonalsPluginConfig?.christmas || {}; +const config = window.SeasonalsPluginConfig?.Christmas || {}; -const christmas = config.enableChristmas !== undefined ? config.enableChristmas : true; // enable/disable christmas -const randomChristmas = config.enableRandomChristmas !== undefined ? config.enableRandomChristmas : true; // enable random Christmas -const randomChristmasMobile = config.enableRandomChristmasMobile !== undefined ? config.enableRandomChristmasMobile : false; // enable random Christmas on mobile devices (Warning: High values may affect performance) -const enableDiffrentDuration = config.enableDifferentDuration !== undefined ? config.enableDifferentDuration : true; // enable different duration for the random Christmas symbols -const christmasCount = config.symbolCount || 25; // count of random extra christmas +const christmas = config.EnableChristmas !== undefined ? config.EnableChristmas : true; // enable/disable christmas +const randomChristmas = config.EnableRandomChristmas !== undefined ? config.EnableRandomChristmas : true; // enable random Christmas +const randomChristmasMobile = config.EnableRandomChristmasMobile !== undefined ? config.EnableRandomChristmasMobile : false; // enable random Christmas on mobile devices (Warning: High values may affect performance) +const enableDiffrentDuration = config.EnableDifferentDuration !== undefined ? config.EnableDifferentDuration : true; // enable different duration for the random Christmas symbols +const christmasCount = config.SymbolCount || 25; // count of random extra christmas let msgPrinted = false; // flag to prevent multiple console messages diff --git a/Jellyfin.Plugin.Seasonals/Web/easter.js b/Jellyfin.Plugin.Seasonals/Web/easter.js index 5d9ac67..ac42d7e 100644 --- a/Jellyfin.Plugin.Seasonals/Web/easter.js +++ b/Jellyfin.Plugin.Seasonals/Web/easter.js @@ -1,16 +1,16 @@ -const config = window.SeasonalsPluginConfig?.easter || {}; +const config = window.SeasonalsPluginConfig?.Easter || {}; -const easter = config.enableEaster !== undefined ? config.enableEaster : true; // enable/disable easter -const randomEaster = config.enableRandomEaster !== undefined ? config.enableRandomEaster : true; // enable random easter -const randomEasterMobile = config.enableRandomEasterMobile !== undefined ? config.enableRandomEasterMobile : false; // enable random easter on mobile devices (Warning: High values may affect performance) -const enableDiffrentDuration = config.enableDifferentDuration !== undefined ? config.enableDifferentDuration : true; // enable different duration for the random easter -const easterEggCount = config.eggCount || 20; // count of random extra easter +const easter = config.EnableEaster !== undefined ? config.EnableEaster : true; // enable/disable easter +const randomEaster = config.EnableRandomEaster !== undefined ? config.EnableRandomEaster : true; // enable random easter +const randomEasterMobile = config.EnableRandomEasterMobile !== undefined ? config.EnableRandomEasterMobile : false; // enable random easter on mobile devices (Warning: High values may affect performance) +const enableDiffrentDuration = config.EnableDifferentDuration !== undefined ? config.EnableDifferentDuration : true; // enable different duration for the random easter +const easterEggCount = config.EggCount || 20; // count of random extra easter -const bunny = config.enableBunny !== undefined ? config.enableBunny : true; // enable/disable hopping bunny -const bunnyDuration = config.bunnyDuration || 12000; // duration of the bunny animation in ms -const hopHeight = config.hopHeight || 12; // height of the bunny hops in px -const minBunnyRestTime = config.minBunnyRestTime || 2000; // minimum time the bunny rests in ms -const maxBunnyRestTime = config.maxBunnyRestTime || 5000; // maximum time the bunny rests in ms +const bunny = config.EnableBunny !== undefined ? config.EnableBunny : true; // enable/disable hopping bunny +const bunnyDuration = config.BunnyDuration || 12000; // duration of the bunny animation in ms +const hopHeight = config.HopHeight || 12; // height of the bunny hops in px +const minBunnyRestTime = config.MinBunnyRestTime || 2000; // minimum time the bunny rests in ms +const maxBunnyRestTime = config.MaxBunnyRestTime || 5000; // maximum time the bunny rests in ms let msgPrinted = false; // flag to prevent multiple console messages diff --git a/Jellyfin.Plugin.Seasonals/Web/fireworks.js b/Jellyfin.Plugin.Seasonals/Web/fireworks.js index 6852c81..130b603 100644 --- a/Jellyfin.Plugin.Seasonals/Web/fireworks.js +++ b/Jellyfin.Plugin.Seasonals/Web/fireworks.js @@ -1,11 +1,11 @@ -const config = window.SeasonalsPluginConfig?.fireworks || {}; +const config = window.SeasonalsPluginConfig?.Fireworks || {}; -const fireworks = config.enableFireworks !== undefined ? config.enableFireworks : true; // enable/disable fireworks -const scrollFireworks = config.scrollFireworks !== undefined ? config.scrollFireworks : true; // enable fireworks to scroll with page content -const particlesPerFirework = config.particleCount || 50; // count of particles per firework (Warning: High values may affect performance) -const minFireworks = config.minFireworks || 3; // minimum number of simultaneous fireworks -const maxFireworks = config.maxFireworks || 6; // maximum number of simultaneous fireworks -const intervalOfFireworks = config.launchInterval || 3200; // interval for the fireworks in milliseconds +const fireworks = config.EnableFireworks !== undefined ? config.EnableFireworks : true; // enable/disable fireworks +const scrollFireworks = config.ScrollFireworks !== undefined ? config.ScrollFireworks : true; // enable fireworks to scroll with page content +const particlesPerFirework = config.ParticleCount || 50; // count of particles per firework (Warning: High values may affect performance) +const minFireworks = config.MinFireworks || 3; // minimum number of simultaneous fireworks +const maxFireworks = config.MaxFireworks || 6; // maximum number of simultaneous fireworks +const intervalOfFireworks = config.LaunchInterval || 3200; // interval for the fireworks in milliseconds // array of color palettes for the fireworks const colorPalettes = [ diff --git a/Jellyfin.Plugin.Seasonals/Web/halloween.js b/Jellyfin.Plugin.Seasonals/Web/halloween.js index 10f6cb8..4982bd2 100644 --- a/Jellyfin.Plugin.Seasonals/Web/halloween.js +++ b/Jellyfin.Plugin.Seasonals/Web/halloween.js @@ -1,10 +1,10 @@ -const config = window.SeasonalsPluginConfig?.halloween || {}; +const config = window.SeasonalsPluginConfig?.Halloween || {}; -const halloween = config.enableHalloween !== undefined ? config.enableHalloween : true; // enable/disable halloween -const randomSymbols = config.enableRandomSymbols !== undefined ? config.enableRandomSymbols : true; // enable more random symbols -const randomSymbolsMobile = config.enableRandomSymbolsMobile !== undefined ? config.enableRandomSymbolsMobile : false; // enable random symbols on mobile devices (Warning: High values may affect performance) -const enableDiffrentDuration = config.enableDifferentDuration !== undefined ? config.enableDifferentDuration : true; // enable different duration for the random halloween symbols -const halloweenCount = config.symbolCount || 25; // count of random extra symbols +const halloween = config.EnableHalloween !== undefined ? config.EnableHalloween : true; // enable/disable halloween +const randomSymbols = config.EnableRandomSymbols !== undefined ? config.EnableRandomSymbols : true; // enable more random symbols +const randomSymbolsMobile = config.EnableRandomSymbolsMobile !== undefined ? config.EnableRandomSymbolsMobile : false; // enable random symbols on mobile devices (Warning: High values may affect performance) +const enableDiffrentDuration = config.EnableDifferentDuration !== undefined ? config.EnableDifferentDuration : true; // enable different duration for the random halloween symbols +const halloweenCount = config.SymbolCount || 25; // count of random extra symbols let msgPrinted = false; // flag to prevent multiple console messages diff --git a/Jellyfin.Plugin.Seasonals/Web/hearts.js b/Jellyfin.Plugin.Seasonals/Web/hearts.js index 26e3644..bad2a52 100644 --- a/Jellyfin.Plugin.Seasonals/Web/hearts.js +++ b/Jellyfin.Plugin.Seasonals/Web/hearts.js @@ -1,10 +1,10 @@ -const config = window.SeasonalsPluginConfig?.hearts || {}; +const config = window.SeasonalsPluginConfig?.Hearts || {}; -const hearts = config.enableHearts !== undefined ? config.enableHearts : true; // enable/disable hearts -const randomSymbols = config.enableRandomSymbols !== undefined ? config.enableRandomSymbols : true; // enable more random symbols -const randomSymbolsMobile = config.enableRandomSymbolsMobile !== undefined ? config.enableRandomSymbolsMobile : false; // enable random symbols on mobile devices (Warning: High values may affect performance) -const enableDiffrentDuration = config.enableDifferentDuration !== undefined ? config.enableDifferentDuration : true; // enable different animation duration for random symbols -const heartsCount = config.symbolCount || 25; // count of random extra symbols +const hearts = config.EnableHearts !== undefined ? config.EnableHearts : true; // enable/disable hearts +const randomSymbols = config.EnableRandomSymbols !== undefined ? config.EnableRandomSymbols : true; // enable more random symbols +const randomSymbolsMobile = config.EnableRandomSymbolsMobile !== undefined ? config.EnableRandomSymbolsMobile : false; // enable random symbols on mobile devices (Warning: High values may affect performance) +const enableDiffrentDuration = config.EnableDifferentDuration !== undefined ? config.EnableDifferentDuration : true; // enable different animation duration for random symbols +const heartsCount = config.SymbolCount || 25; // count of random extra symbols let msgPrinted = false; // flag to prevent multiple console messages diff --git a/Jellyfin.Plugin.Seasonals/Web/santa.js b/Jellyfin.Plugin.Seasonals/Web/santa.js index 67d2614..0ce7e86 100644 --- a/Jellyfin.Plugin.Seasonals/Web/santa.js +++ b/Jellyfin.Plugin.Seasonals/Web/santa.js @@ -1,15 +1,15 @@ -const config = window.SeasonalsPluginConfig?.santa || {}; +const config = window.SeasonalsPluginConfig?.Santa || {}; -const santaIsFlying = config.enableSanta !== undefined ? config.enableSanta : true; // enable/disable santa -let snowflakesCount = config.snowflakesCount || 500; // count of snowflakes (recommended values: 300-600) -const snowflakesCountMobile = config.snowflakesCountMobile || 250; // count of snowflakes on mobile devices (Warning: High values may affect performance) -const snowFallSpeed = config.snowFallSpeed || 3; // speed of snowfall (recommended values: 0-5) -const santaSpeed = config.santaSpeed || 10; // speed of santa in seconds (recommended values: 5-15) -const santaSpeedMobile = config.santaSpeedMobile || 8; // speed of santa on mobile devices in seconds -const maxSantaRestTime = config.maxSantaRestTime || 8; // maximum time santa rests in seconds -const minSantaRestTime = config.minSantaRestTime || 3; // minimum time santa rests in seconds -const maxPresentFallSpeed = config.maxPresentFallSpeed || 5; // maximum speed of falling presents in seconds -const minPresentFallSpeed = config.minPresentFallSpeed || 2; // minimum speed of falling presents in seconds +const santaIsFlying = config.EnableSanta !== undefined ? config.EnableSanta : true; // enable/disable santa +let snowflakesCount = config.SnowflakesCount || 500; // count of snowflakes (recommended values: 300-600) +const snowflakesCountMobile = config.SnowflakesCountMobile || 250; // count of snowflakes on mobile devices (Warning: High values may affect performance) +const snowFallSpeed = config.SnowFallSpeed || 3; // speed of snowfall (recommended values: 0-5) +const santaSpeed = config.SantaSpeed || 10; // speed of santa in seconds (recommended values: 5-15) +const santaSpeedMobile = config.SantaSpeedMobile || 8; // speed of santa on mobile devices in seconds +const maxSantaRestTime = config.MaxSantaRestTime || 8; // maximum time santa rests in seconds +const minSantaRestTime = config.MinSantaRestTime || 3; // minimum time santa rests in seconds +const maxPresentFallSpeed = config.MaxPresentFallSpeed || 5; // maximum speed of falling presents in seconds +const minPresentFallSpeed = config.MinPresentFallSpeed || 2; // minimum speed of falling presents in seconds let msgPrinted = false; // flag to prevent multiple console messages let isMobile = false; // flag to detect mobile devices diff --git a/Jellyfin.Plugin.Seasonals/Web/seasonals.js b/Jellyfin.Plugin.Seasonals/Web/seasonals.js index d60b67c..08f4513 100644 --- a/Jellyfin.Plugin.Seasonals/Web/seasonals.js +++ b/Jellyfin.Plugin.Seasonals/Web/seasonals.js @@ -159,7 +159,6 @@ async function initializeTheme() { const response = await fetch('/Seasonals/Config'); if (response.ok) { const config = await response.json(); - // automateThemeSelection = config.automateSeasonSelection; automateThemeSelection = config.AutomateSeasonSelection; defaultTheme = config.SelectedSeason; window.SeasonalsPluginConfig = config; diff --git a/Jellyfin.Plugin.Seasonals/Web/snowfall.js b/Jellyfin.Plugin.Seasonals/Web/snowfall.js index 9c78638..bea3409 100644 --- a/Jellyfin.Plugin.Seasonals/Web/snowfall.js +++ b/Jellyfin.Plugin.Seasonals/Web/snowfall.js @@ -1,9 +1,9 @@ -const config = window.SeasonalsPluginConfig?.snowfall || {}; +const config = window.SeasonalsPluginConfig?.Snowfall || {}; -const snowfall = config.enableSnowfall !== undefined ? config.enableSnowfall : true; // enable/disable snowfall -let snowflakesCount = config.snowflakesCount || 500; // count of snowflakes (recommended values: 300-600) -const snowflakesCountMobile = config.snowflakesCountMobile || 250; // count of snowflakes on mobile devices (Warning: High values may affect performance) -const snowFallSpeed = config.speed || 3; // speed of snowfall (recommended values: 0-5) +const snowfall = config.EnableSnowfall !== undefined ? config.EnableSnowfall : true; // enable/disable snowfall +let snowflakesCount = config.SnowflakesCount || 500; // count of snowflakes (recommended values: 300-600) +const snowflakesCountMobile = config.SnowflakesCountMobile || 250; // count of snowflakes on mobile devices (Warning: High values may affect performance) +const snowFallSpeed = config.Speed || 3; // speed of snowfall (recommended values: 0-5) let msgPrinted = false; // flag to prevent multiple console messages diff --git a/Jellyfin.Plugin.Seasonals/Web/snowflakes.js b/Jellyfin.Plugin.Seasonals/Web/snowflakes.js index 5c2bf30..9521e64 100644 --- a/Jellyfin.Plugin.Seasonals/Web/snowflakes.js +++ b/Jellyfin.Plugin.Seasonals/Web/snowflakes.js @@ -1,11 +1,11 @@ -const config = window.SeasonalsPluginConfig?.snowflakes || {}; +const config = window.SeasonalsPluginConfig?.Snowflakes || {}; -const snowflakes = config.enableSnowflakes !== undefined ? config.enableSnowflakes : true; // enable/disable snowflakes -const randomSnowflakes = config.enableRandomSnowflakes !== undefined ? config.enableRandomSnowflakes : true; // enable random Snowflakes -const randomSnowflakesMobile = config.enableRandomSnowflakesMobile !== undefined ? config.enableRandomSnowflakesMobile : false; // enable random Snowflakes on mobile devices (Warning: High values may affect performance) -const enableColoredSnowflakes = config.enableColoredSnowflakes !== undefined ? config.enableColoredSnowflakes : true; // enable colored snowflakes on mobile devices -const enableDiffrentDuration = config.enableDifferentDuration !== undefined ? config.enableDifferentDuration : true; // enable different animation duration for random symbols -const snowflakeCount = config.snowflakeCount || 25; // count of random extra snowflakes +const snowflakes = config.EnableSnowflakes !== undefined ? config.EnableSnowflakes : true; // enable/disable snowflakes +const randomSnowflakes = config.EnableRandomSnowflakes !== undefined ? config.EnableRandomSnowflakes : true; // enable random Snowflakes +const randomSnowflakesMobile = config.EnableRandomSnowflakesMobile !== undefined ? config.EnableRandomSnowflakesMobile : false; // enable random Snowflakes on mobile devices +const enableColoredSnowflakes = config.EnableColoredSnowflakes !== undefined ? config.EnableColoredSnowflakes : true; // enable colored snowflakes +const enableDiffrentDuration = config.EnableDifferentDuration !== undefined ? config.EnableDifferentDuration : true; // enable different animation duration +const snowflakeCount = config.SnowflakeCount || 25; // count of random extra snowflakes let msgPrinted = false; // flag to prevent multiple console messages diff --git a/Jellyfin.Plugin.Seasonals/Web/snowstorm.js b/Jellyfin.Plugin.Seasonals/Web/snowstorm.js index 254b364..b9677d5 100644 --- a/Jellyfin.Plugin.Seasonals/Web/snowstorm.js +++ b/Jellyfin.Plugin.Seasonals/Web/snowstorm.js @@ -1,11 +1,11 @@ -const config = window.SeasonalsPluginConfig?.snowstorm || {}; +const config = window.SeasonalsPluginConfig?.Snowstorm || {}; -const snowstorm = config.enableSnowstorm !== undefined ? config.enableSnowstorm : true; // enable/disable snowstorm -let snowflakesCount = config.snowflakesCount || 500; // count of snowflakes (recommended values: 300-600) -const snowflakesCountMobile = config.snowflakesCountMobile || 250; // count of snowflakes on mobile devices (Warning: High values may affect performance) -const snowFallSpeed = config.speed || 6; // speed of snowfall (recommended values: 4-8) -const horizontalWind = config.horizontalWind || 4; // horizontal wind speed (recommended value: 4) -const verticalVariation = config.verticalVariation || 2; // vertical variation (recommended value: 2) +const snowstorm = config.enableSnowstorm !== undefined ? config.EnableSnowstorm : true; // enable/disable snowstorm +let snowflakesCount = config.SnowflakesCount || 500; // count of snowflakes (recommended values: 300-600) +const snowflakesCountMobile = config.SnowflakesCountMobile || 250; // count of snowflakes on mobile devices (Warning: High values may affect performance) +const snowFallSpeed = config.Speed || 6; // speed of snowfall (recommended values: 4-8) +const horizontalWind = config.HorizontalWind || 4; // horizontal wind speed (recommended value: 4) +const verticalVariation = config.VerticalVariation || 2; // vertical variation (recommended value: 2) let msgPrinted = false; // flag to prevent multiple console messages