Compare commits
13 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
4270235c78 | ||
|
|
76d8a67914 | ||
|
|
1a3caf5da6 | ||
|
|
3b3ef77e61 | ||
|
|
ba580b1b52 | ||
|
|
0a6284c716 | ||
|
|
f83e863664 | ||
|
|
747e8ed6bc | ||
|
|
30845442b2 | ||
|
|
bb83201736 | ||
|
|
457ae404ba | ||
|
|
b6d679f6ef | ||
|
|
3b88a1809d |
@@ -88,17 +88,20 @@
|
||||
|
||||
<!-- Auto Selection Tab -->
|
||||
<div id="seasonals-auto-selection" class="seasonals-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;">
|
||||
<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>
|
||||
<h2>Auto Selection Rules</h2>
|
||||
|
||||
<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;">
|
||||
<i class="material-icons" style="color: #00a4dc; font-size: 24px;">info</i>
|
||||
<div>Define rules to automatically select a season based on the date. Rules are evaluated from top to bottom. The first matching rule wins.</div>
|
||||
</div>
|
||||
|
||||
<div id="seasonalRulesList">
|
||||
<!-- Rules will be injected here via JS -->
|
||||
</div>
|
||||
|
||||
<button is="emby-button" type="button" class="raised button-accent block" onclick="SeasonalsConfigPage.addRule();">
|
||||
<i class="material-icons button-icon button-icon-left">add</i>
|
||||
<button is="emby-button" type="button" class="raised emby-button" onclick="SeasonalsConfigPage.addRule();"
|
||||
style="margin-top: 1em; display: inline-flex; align-items: center; gap: 0.4em;">
|
||||
<i class="material-icons" style="font-size: 24px;">add</i>
|
||||
<span>Add Rule</span>
|
||||
</button>
|
||||
</div>
|
||||
@@ -613,8 +616,7 @@
|
||||
}
|
||||
.seasonal-rule-content {
|
||||
display: grid;
|
||||
/* grid-template-columns: 2fr 1fr 1fr 2fr; */
|
||||
grid-template-columns: 2fr 1.2fr 1.2fr 1.6fr;
|
||||
grid-template-columns: 2fr 1.3fr 1.3fr 2fr;
|
||||
gap: 15px;
|
||||
align-items: end;
|
||||
}
|
||||
@@ -626,7 +628,13 @@
|
||||
display: flex;
|
||||
gap: 10px;
|
||||
align-items: flex-end;
|
||||
justify-content: space-between;
|
||||
}
|
||||
.date-range-group > .inputContainer,
|
||||
.date-range-group > .selectContainer {
|
||||
flex: 1;
|
||||
}
|
||||
|
||||
@media (max-width: 800px) {
|
||||
.seasonal-rule-content {
|
||||
grid-template-columns: 1fr;
|
||||
@@ -639,10 +647,10 @@
|
||||
border-bottom: 2px solid #00a4dc !important;
|
||||
}
|
||||
|
||||
/* Disabled options in selects
|
||||
/* Disabled options in selects */
|
||||
select option:disabled {
|
||||
color: #a3a3a3 !important;
|
||||
} */
|
||||
}
|
||||
</style>
|
||||
<script>
|
||||
function showSeasonalsTab(tabId, btn) {
|
||||
@@ -665,6 +673,39 @@
|
||||
var SeasonalsConfigPage = {
|
||||
pluginUniqueId: 'ef1e863f-cbb0-4e47-9f23-f0cbb1826ad4',
|
||||
|
||||
getDaysOptions: function(selectedDay) {
|
||||
var options = '';
|
||||
for (var i = 1; i <= 31; i++) {
|
||||
var isSelected = i === selectedDay ? 'selected' : '';
|
||||
options += '<option value="' + i + '" ' + isSelected + '>' + i + '</option>';
|
||||
}
|
||||
return options;
|
||||
},
|
||||
|
||||
getMonthsOptions: function(selectedMonth) {
|
||||
var months = [
|
||||
{ val: 1, name: 'Jan' },
|
||||
{ val: 2, name: 'Feb' },
|
||||
{ val: 3, name: 'Mar' },
|
||||
{ val: 4, name: 'Apr' },
|
||||
{ val: 5, name: 'May' },
|
||||
{ val: 6, name: 'Jun' },
|
||||
{ val: 7, name: 'Jul' },
|
||||
{ val: 8, name: 'Aug' },
|
||||
{ val: 9, name: 'Sep' },
|
||||
{ val: 10, name: 'Oct' },
|
||||
{ val: 11, name: 'Nov' },
|
||||
{ val: 12, name: 'Dec' }
|
||||
];
|
||||
var options = '';
|
||||
for (var i = 0; i < months.length; i++) {
|
||||
var m = months[i];
|
||||
var isSelected = m.val === selectedMonth ? 'selected' : '';
|
||||
options += '<option value="' + m.val + '" ' + isSelected + '>' + m.name + '</option>';
|
||||
}
|
||||
return options;
|
||||
},
|
||||
|
||||
addRule: function(data = null) {
|
||||
var container = document.querySelector('#seasonalRulesList');
|
||||
var div = document.createElement('div');
|
||||
@@ -679,7 +720,7 @@
|
||||
|
||||
div.innerHTML = `
|
||||
<div class="seasonal-rule-header">
|
||||
<div style="font-weight: bold; font-size: 1.1em;" class="rule-title">${name}</div>
|
||||
<div style="font-weight: bold; font-size: 1.1em;" class="rule-title"></div>
|
||||
<div class="rule-actions">
|
||||
<button type="button" is="paper-icon-button-light" class="btn-move-up" title="Move Up"><i class="material-icons">arrow_upward</i></button>
|
||||
<button type="button" is="paper-icon-button-light" class="btn-move-down" title="Move Down"><i class="material-icons">arrow_downward</i></button>
|
||||
@@ -689,27 +730,35 @@
|
||||
<div class="seasonal-rule-content">
|
||||
<div class="inputContainer" style="margin:0;">
|
||||
<label class="inputLabel">Name</label>
|
||||
<input is="emby-input" class="rule-name" onchange="this.closest('.seasonal-rule').querySelector('.rule-title').innerText = this.value" />
|
||||
<input is="emby-input" class="rule-name" onchange="SeasonalsConfigPage.updateRuleTitles();" />
|
||||
</div>
|
||||
<div class="date-range-group">
|
||||
<div class="inputContainer" style="margin:0;">
|
||||
<label class="inputLabel">Start Day</label>
|
||||
<input is="emby-input" type="number" class="rule-start-day" min="1" max="31" />
|
||||
<div class="selectContainer" style="margin:0; flex: 1;">
|
||||
<label class="selectLabel">Start Day</label>
|
||||
<select is="emby-select" class="rule-start-day" style="width: 100%;">
|
||||
${this.getDaysOptions(startDay)}
|
||||
</select>
|
||||
</div>
|
||||
<div class="inputContainer" style="margin:0;">
|
||||
<label class="inputLabel">Month</label>
|
||||
<input is="emby-input" type="number" class="rule-start-month" min="1" max="12" />
|
||||
<div class="selectContainer" style="margin:0; flex: 1;">
|
||||
<label class="selectLabel">Month</label>
|
||||
<select is="emby-select" class="rule-start-month" style="width: 100%;">
|
||||
${this.getMonthsOptions(startMonth)}
|
||||
</select>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="date-range-group">
|
||||
<div class="inputContainer" style="margin:0;">
|
||||
<label class="inputLabel">End Day</label>
|
||||
<input is="emby-input" type="number" class="rule-end-day" min="1" max="31" />
|
||||
<div class="selectContainer" style="margin:0; flex: 1;">
|
||||
<label class="selectLabel">End Day</label>
|
||||
<select is="emby-select" class="rule-end-day" style="width: 100%;">
|
||||
${this.getDaysOptions(endDay)}
|
||||
</select>
|
||||
</div>
|
||||
<div class="inputContainer" style="margin:0;">
|
||||
<label class="inputLabel">Month</label>
|
||||
<input is="emby-input" type="number" class="rule-end-month" min="1" max="12" />
|
||||
<div class="selectContainer" style="margin:0; flex: 1;">
|
||||
<label class="selectLabel">Month</label>
|
||||
<select is="emby-select" class="rule-end-month" style="width: 100%;">
|
||||
${this.getMonthsOptions(endMonth)}
|
||||
</select>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
@@ -727,6 +776,7 @@
|
||||
<option value="santa">Santa</option>
|
||||
<option value="autumn">Autumn</option>
|
||||
<option value="easter">Easter</option>
|
||||
<option value="resurrection">Resurrection</option>
|
||||
</select>
|
||||
</div>
|
||||
</div>
|
||||
@@ -734,9 +784,8 @@
|
||||
|
||||
container.appendChild(div);
|
||||
|
||||
// Set values programmatically to ensure they are correctly populated
|
||||
// Set values programmatically
|
||||
div.querySelector('.rule-name').value = name;
|
||||
div.querySelector('.rule-title').innerText = name;
|
||||
div.querySelector('.rule-start-day').value = startDay;
|
||||
div.querySelector('.rule-start-month').value = startMonth;
|
||||
div.querySelector('.rule-end-day').value = endDay;
|
||||
@@ -746,17 +795,30 @@
|
||||
// Bind events
|
||||
div.querySelector('.btn-remove').addEventListener('click', function() {
|
||||
div.remove();
|
||||
SeasonalsConfigPage.updateRuleTitles();
|
||||
});
|
||||
div.querySelector('.btn-move-up').addEventListener('click', function() {
|
||||
if (div.previousElementSibling) {
|
||||
container.insertBefore(div, div.previousElementSibling);
|
||||
SeasonalsConfigPage.updateRuleTitles();
|
||||
}
|
||||
});
|
||||
div.querySelector('.btn-move-down').addEventListener('click', function() {
|
||||
if (div.nextElementSibling) {
|
||||
container.insertBefore(div.nextElementSibling, div);
|
||||
SeasonalsConfigPage.updateRuleTitles();
|
||||
}
|
||||
});
|
||||
|
||||
this.updateRuleTitles();
|
||||
},
|
||||
|
||||
updateRuleTitles: function() {
|
||||
var rules = document.querySelectorAll('.seasonal-rule');
|
||||
rules.forEach((rule, index) => {
|
||||
var name = rule.querySelector('.rule-name').value;
|
||||
rule.querySelector('.rule-title').innerText = '#' + (index + 1) + ' ' + name;
|
||||
});
|
||||
},
|
||||
|
||||
renderRules: function(rules) {
|
||||
|
||||
@@ -12,7 +12,7 @@
|
||||
<!-- <TreatWarningsAsErrors>false</TreatWarningsAsErrors> -->
|
||||
<Title>Jellyfin Seasonals Plugin</Title>
|
||||
<Authors>CodeDevMLH</Authors>
|
||||
<Version>1.7.0.6</Version>
|
||||
<Version>1.7.0.10</Version>
|
||||
<RepositoryUrl>https://github.com/CodeDevMLH/Jellyfin-Seasonals</RepositoryUrl>
|
||||
</PropertyGroup>
|
||||
|
||||
|
||||
@@ -9,12 +9,12 @@
|
||||
"imageUrl": "https://git.mahom03-spacecloud.de/CodeDevMLH/Jellyfin-Seasonals-Plugin/raw/branch/main/logo.png",
|
||||
"versions": [
|
||||
{
|
||||
"version": "1.7.0.5",
|
||||
"version": "1.7.0.10",
|
||||
"changelog": "- feat: add customizable auto seasonal list via config page\n- feat: add new season theme 'resurrection' by Bioflash257",
|
||||
"targetAbi": "10.11.0.0",
|
||||
"sourceUrl": "https://git.mahom03-spacecloud.de/CodeDevMLH/Jellyfin-Seasonals-Plugin/releases/download/v1.7.0.5/Jellyfin.Plugin.Seasonals.zip",
|
||||
"checksum": "dc018048e121b88469b8d8340970b2a6",
|
||||
"timestamp": "2026-02-16T17:16:02Z"
|
||||
"sourceUrl": "https://git.mahom03-spacecloud.de/CodeDevMLH/Jellyfin-Seasonals-Plugin/releases/download/v1.7.0.10/Jellyfin.Plugin.Seasonals.zip",
|
||||
"checksum": "8ff32aad07b862b7b56aabad7ea0794b",
|
||||
"timestamp": "2026-02-16T22:02:52Z"
|
||||
},
|
||||
{
|
||||
"version": "1.6.3.0",
|
||||
|
||||
Reference in New Issue
Block a user