This commit is contained in:
CodeDevMLH
2026-02-16 16:12:52 +01:00
parent ee724fedc8
commit 4f7243bc74
2 changed files with 79 additions and 16 deletions

View File

@@ -27,6 +27,7 @@ public class PluginConfiguration : BasePluginConfiguration
Christmas = new ChristmasOptions(); Christmas = new ChristmasOptions();
Santa = new SantaOptions(); Santa = new SantaOptions();
Easter = new EasterOptions(); Easter = new EasterOptions();
Resurrection = new ResurrectionOptions();
} }
/// <summary> /// <summary>
@@ -67,6 +68,7 @@ public class PluginConfiguration : BasePluginConfiguration
public ChristmasOptions Christmas { get; set; } public ChristmasOptions Christmas { get; set; }
public SantaOptions Santa { get; set; } public SantaOptions Santa { get; set; }
public EasterOptions Easter { get; set; } public EasterOptions Easter { get; set; }
public ResurrectionOptions Resurrection { get; set; }
} }
public class AutumnOptions public class AutumnOptions
@@ -171,3 +173,12 @@ public class EasterOptions
public int MinBunnyRestTime { get; set; } = 2000; public int MinBunnyRestTime { get; set; } = 2000;
public int MaxBunnyRestTime { get; set; } = 5000; public int MaxBunnyRestTime { get; set; } = 5000;
} }
public class ResurrectionOptions
{
public int SymbolCount { get; set; } = 12;
public bool EnableResurrection { get; set; } = true;
public bool EnableRandomSymbols { get; set; } = true;
public bool EnableRandomSymbolsMobile { get; set; } = false;
public bool EnableDifferentDuration { get; set; } = true;
}

View File

@@ -19,23 +19,23 @@
<hr style="max-width: 800px; margin: 1em 0;"> <hr style="max-width: 800px; margin: 1em 0;">
<div style="margin-bottom: 1.5em;"> <div style="margin-bottom: 1.5em;">
<button class="jellyfin-tab-button active" onclick="showTab('basic', this)" <button class="jellyfin-tab-button active" onclick="showTab('seasonals-basic', this)"
style="background: none; border: none; color: #fff; cursor: pointer; transition: color 0.3s, border-bottom 0.3s; padding: 0.5em 1em; border-bottom: 2px solid #00a4dc;"> style="background: none; border: none; color: #fff; cursor: pointer; transition: color 0.3s, border-bottom 0.3s; padding: 0.5em 1em; border-bottom: 2px solid #00a4dc;">
<h3>General Settings</h3> <h3>General Settings</h3>
</button> </button>
<button class="jellyfin-tab-button" onclick="showTab('auto-selection', this)" <button class="jellyfin-tab-button" onclick="showTab('seasonals-auto-selection', this)"
style="background: none; border: none; color: #ccc; cursor: pointer; transition: color 0.3s, border-bottom 0.3s; padding: 0.5em 1em; border-bottom: 2px solid transparent;"> style="background: none; border: none; color: #ccc; cursor: pointer; transition: color 0.3s, border-bottom 0.3s; padding: 0.5em 1em; border-bottom: 2px solid transparent;">
<h3>Auto Selection</h3> <h3>Auto Selection</h3>
</button> </button>
<button class="jellyfin-tab-button" onclick="showTab('advanced', this)" <button class="jellyfin-tab-button" onclick="showTab('seasonals-advanced', this)"
style="background: none; border: none; color: #ccc; cursor: pointer; transition: color 0.3s, border-bottom 0.3s; padding: 0.5em 1em; border-bottom: 2px solid transparent;"> style="background: none; border: none; color: #ccc; cursor: pointer; transition: color 0.3s, border-bottom 0.3s; padding: 0.5em 1em; border-bottom: 2px solid transparent;">
<h3>Advanced Settings</h3> <h3>Advanced Settings</h3>
</button> </button>
</div> </div>
<form id="SeasonalsConfigForm"> <form id="SeasonalsConfigForm">
<!-- General Tab --> <!-- BASIC Tab -->
<div id="general" class="tab-content"> <div id="seasonals-basic" class="tab-content">
<div class="checkboxContainer checkboxContainer-withDescription"> <div class="checkboxContainer checkboxContainer-withDescription">
<label class="emby-checkbox-label"> <label class="emby-checkbox-label">
<input id="IsEnabled" name="IsEnabled" type="checkbox" is="emby-checkbox" /> <input id="IsEnabled" name="IsEnabled" type="checkbox" is="emby-checkbox" />
@@ -86,7 +86,7 @@
</div> </div>
<!-- Auto Selection Tab --> <!-- Auto Selection Tab -->
<div id="auto-selection" class="tab-content" style="display: none;"> <div id="seasonals-auto-selection" class="tab-content" style="display: none;">
<div style="background-color: rgba(255, 255, 255, 0.05); border-left: 4px solid #00a4dc; border-radius: 4px; padding: 1em 1.5em; margin-bottom: 1.5em;"> <div style="background-color: rgba(255, 255, 255, 0.05); border-left: 4px solid #00a4dc; border-radius: 4px; padding: 1em 1.5em; margin-bottom: 1.5em;">
<h3>Auto Selection Rules</h3> <h3>Auto Selection Rules</h3>
<p>Define rules to automatically select a season based on the date. Rules are evaluated from top to bottom. The first matching rule wins.</p> <p>Define rules to automatically select a season based on the date. Rules are evaluated from top to bottom. The first matching rule wins.</p>
@@ -96,14 +96,14 @@
<!-- Rules will be injected here via JS --> <!-- Rules will be injected here via JS -->
</div> </div>
<button is="emby-button" type="button" class="raised block" onclick="SeasonalsConfigPage.addRule()"> <button is="emby-button" type="button" class="raised button-accent block" onclick="SeasonalsConfigPage.addRule();">
<i class="md-icon button-icon button-icon-left">add</i> <i class="material-icons button-icon button-icon-left">add</i>
<span>Add Rule</span> <span>Add Rule</span>
</button> </button>
</div> </div>
<!-- Advanced Tab --> <!-- Advanced Tab -->
<div id="advanced" class="tab-content" style="display: none;"> <div id="seasonals-advanced" class="tab-content" style="display: none;">
<p>Configure specific settings for each seasonal theme below.</p> <p>Configure specific settings for each seasonal theme below.</p>
<p>All symbol count settings add this number in addition to the standard 12 symbols (if additional symbols is enabled).</p> <p>All symbol count settings add this number in addition to the standard 12 symbols (if additional symbols is enabled).</p>
<details> <details>
@@ -533,6 +533,44 @@
<div class="fieldDescription">Maximum time the bunny waits before appearing again.</div> <div class="fieldDescription">Maximum time the bunny waits before appearing again.</div>
</div> </div>
</details> </details>
<hr style="max-width: 800px; margin: 1em 0;">
<details>
<summary>Resurrection</summary>
<div class="checkboxContainer checkboxContainer-withDescription">
<label class="emby-checkbox-label">
<input id="EnableResurrection" name="EnableResurrection" type="checkbox" is="emby-checkbox" />
<span>Enable Resurrection Seasonal</span>
</label>
<div class="fieldDescription">Enable the Resurrection theme in general (e.g. for automation).</div>
</div>
<div class="checkboxContainer checkboxContainer-withDescription">
<label class="emby-checkbox-label">
<input id="EnableRandomResurrection" name="EnableRandomResurrection" type="checkbox" is="emby-checkbox" />
<span>Enable Additional Random Symbols</span>
</label>
<div class="fieldDescription">Displays additional symbols randomly distributed across the screen.</div>
</div>
<div class="checkboxContainer checkboxContainer-withDescription">
<label class="emby-checkbox-label">
<input id="EnableRandomResurrectionMobile" name="EnableRandomResurrectionMobile" type="checkbox" is="emby-checkbox" />
<span>Enable Additional Random Symbols on Mobile</span>
</label>
<div class="fieldDescription">Displays additional symbols randomly distributed across the screen on mobile devices. Warning: High values may affect performance.</div>
</div>
<div class="inputContainer">
<label class="inputLabel" for="ResurrectionSymbolCount">Symbol Count</label>
<input is="emby-input" type="number" id="ResurrectionSymbolCount" name="ResurrectionSymbolCount" />
<div class="fieldDescription">Number of additional symbols (if enabled).</div>
</div>
<div class="checkboxContainer checkboxContainer-withDescription">
<label class="emby-checkbox-label">
<input id="EnableDifferentDurationResurrection" name="EnableDifferentDurationResurrection" type="checkbox" is="emby-checkbox" />
<span>Enable Different Duration</span>
</label>
<div class="fieldDescription">Randomize the movement speed.</div>
</div>
</details>
</div> </div>
<div style="background-color: rgba(255, 255, 255, 0.05); border-left: 4px solid #00a4dc; border-radius: 4px; padding: 1em 1.5em; margin: 1.5em 0; display: flex; align-items: center; gap: 1em;"> <div style="background-color: rgba(255, 255, 255, 0.05); border-left: 4px solid #00a4dc; border-radius: 4px; padding: 1em 1.5em; margin: 1.5em 0; display: flex; align-items: center; gap: 1em;">
@@ -584,7 +622,7 @@
.date-range-group { .date-range-group {
display: flex; display: flex;
gap: 10px; gap: 10px;
align-items: center; align-items: flex-start;
} }
@media (max-width: 800px) { @media (max-width: 800px) {
.seasonal-rule-content { .seasonal-rule-content {
@@ -629,12 +667,12 @@
var div = document.createElement('div'); var div = document.createElement('div');
div.className = 'seasonal-rule'; div.className = 'seasonal-rule';
var name = data ? data.Name : 'New Rule'; var name = data ? (data.Name || data.name || 'New Rule') : 'New Rule';
var startDay = data ? data.StartDay : 1; var startDay = data ? (data.StartDay !== undefined ? data.StartDay : (data.startDay !== undefined ? data.startDay : 1)) : 1;
var startMonth = data ? data.StartMonth : 1; var startMonth = data ? (data.StartMonth !== undefined ? data.StartMonth : (data.startMonth !== undefined ? data.startMonth : 1)) : 1;
var endDay = data ? data.EndDay : 1; var endDay = data ? (data.EndDay !== undefined ? data.EndDay : (data.endDay !== undefined ? data.endDay : 1)) : 1;
var endMonth = data ? data.EndMonth : 1; var endMonth = data ? (data.EndMonth !== undefined ? data.EndMonth : (data.endMonth !== undefined ? data.endMonth : 1)) : 1;
var theme = data ? data.Theme : 'snowflakes'; var theme = data ? (data.Theme || data.theme || 'snowflakes') : 'snowflakes';
div.innerHTML = ` div.innerHTML = `
<div class="seasonal-rule-header"> <div class="seasonal-rule-header">
@@ -835,6 +873,13 @@
document.querySelector('#MinBunnyRestTime').value = config.Easter.MinBunnyRestTime; document.querySelector('#MinBunnyRestTime').value = config.Easter.MinBunnyRestTime;
document.querySelector('#MaxBunnyRestTime').value = config.Easter.MaxBunnyRestTime; document.querySelector('#MaxBunnyRestTime').value = config.Easter.MaxBunnyRestTime;
// Resurrection
document.querySelector('#EnableResurrection').checked = config.Resurrection.EnableResurrection;
document.querySelector('#ResurrectionSymbolCount').value = config.Resurrection.SymbolCount;
document.querySelector('#EnableRandomResurrection').checked = config.Resurrection.EnableRandomSymbols;
document.querySelector('#EnableRandomResurrectionMobile').checked = config.Resurrection.EnableRandomSymbolsMobile;
document.querySelector('#EnableDifferentDurationResurrection').checked = config.Resurrection.EnableDifferentDuration;
Dashboard.hideLoadingMsg(); Dashboard.hideLoadingMsg();
}); });
}); });
@@ -935,6 +980,13 @@
config.Easter.MinBunnyRestTime = parseInt(document.querySelector('#MinBunnyRestTime').value); config.Easter.MinBunnyRestTime = parseInt(document.querySelector('#MinBunnyRestTime').value);
config.Easter.MaxBunnyRestTime = parseInt(document.querySelector('#MaxBunnyRestTime').value); config.Easter.MaxBunnyRestTime = parseInt(document.querySelector('#MaxBunnyRestTime').value);
// Resurrection
config.Resurrection.EnableResurrection = document.querySelector('#EnableResurrection').checked;
config.Resurrection.SymbolCount = parseInt(document.querySelector('#ResurrectionSymbolCount').value);
config.Resurrection.EnableRandomSymbols = document.querySelector('#EnableRandomResurrection').checked;
config.Resurrection.EnableRandomSymbolsMobile = document.querySelector('#EnableRandomResurrectionMobile').checked;
config.Resurrection.EnableDifferentDuration = document.querySelector('#EnableDifferentDurationResurrection').checked;
ApiClient.updatePluginConfiguration(SeasonalsConfigPage.pluginUniqueId, config).then(function (result) { ApiClient.updatePluginConfiguration(SeasonalsConfigPage.pluginUniqueId, config).then(function (result) {
Dashboard.processPluginConfigurationUpdateResult(result); Dashboard.processPluginConfigurationUpdateResult(result);
}); });