Setup scheduler

This commit is contained in:
2026-01-14 01:18:39 +01:00
parent 9147479b00
commit 5f8691e1af
9 changed files with 170 additions and 0 deletions

View File

@@ -0,0 +1 @@
ALTER TABLE settings ADD COLUMN emote_sync_interval_minutes INTEGER NOT NULL DEFAULT 60;

View File

@@ -8,12 +8,14 @@ const minPitchElement = document.getElementById("min-audio-pitch");
const maxPitchElement = document.getElementById("max-audio-pitch");
const minVolumeElement = document.getElementById("min-volume");
const maxVolumeElement = document.getElementById("max-volume");
const emoteSyncIntervalElement = document.getElementById("emote-sync-interval");
const statusElement = document.getElementById("settings-status");
const statCanvasFpsElement = document.getElementById("stat-canvas-fps");
const statCanvasSizeElement = document.getElementById("stat-canvas-size");
const statPlaybackRangeElement = document.getElementById("stat-playback-range");
const statAudioRangeElement = document.getElementById("stat-audio-range");
const statVolumeRangeElement = document.getElementById("stat-volume-range");
const statEmoteSyncElement = document.getElementById("stat-emote-sync");
const sysadminListElement = document.getElementById("sysadmin-list");
const sysadminInputElement = document.getElementById("new-sysadmin");
const addSysadminButtonElement = document.getElementById("add-sysadmin-button");
@@ -55,6 +57,7 @@ function setFormSettings(s) {
maxPitchElement.value = s.maxAssetAudioPitchFraction;
minVolumeElement.value = s.minAssetVolumeFraction;
maxVolumeElement.value = s.maxAssetVolumeFraction;
emoteSyncIntervalElement.value = s.emoteSyncIntervalMinutes;
}
function updateStatCards(settings) {
@@ -64,6 +67,7 @@ function updateStatCards(settings) {
statPlaybackRangeElement.textContent = `${settings.minAssetPlaybackSpeedFraction ?? "--"} ${settings.maxAssetPlaybackSpeedFraction ?? "--"}x`;
statAudioRangeElement.textContent = `${settings.minAssetAudioPitchFraction ?? "--"} ${settings.maxAssetAudioPitchFraction ?? "--"}x`;
statVolumeRangeElement.textContent = `${settings.minAssetVolumeFraction ?? "--"} ${settings.maxAssetVolumeFraction ?? "--"}x`;
statEmoteSyncElement.textContent = `${settings.emoteSyncIntervalMinutes ?? "--"} min`;
}
function readInt(input) {
@@ -83,6 +87,7 @@ function loadUserSettingsFromDom() {
userSettings.maxAssetAudioPitchFraction = readFloat(maxPitchElement);
userSettings.minAssetVolumeFraction = readFloat(minVolumeElement);
userSettings.maxAssetVolumeFraction = readFloat(maxVolumeElement);
userSettings.emoteSyncIntervalMinutes = readInt(emoteSyncIntervalElement);
}
function updateSubmitButtonDisabledState() {

View File

@@ -61,6 +61,11 @@
<p class="stat-value" id="stat-volume-range">--</p>
<p class="stat-subtitle">Keeps alerts comfortable</p>
</div>
<div class="stat">
<p class="stat-label">Emote sync</p>
<p class="stat-value" id="stat-emote-sync">--</p>
<p class="stat-subtitle">Minutes between refreshes</p>
</div>
</div>
</section>
@@ -224,6 +229,31 @@
</p>
</div>
<div class="form-section">
<div class="form-heading">
<p class="eyebrow subtle">Emotes</p>
<h3>Emote sync interval</h3>
<p class="muted tiny">
Choose how often Imgfloat refreshes Twitch and 7TV emote catalogs.
</p>
</div>
<div class="control-grid">
<label for="emote-sync-interval"
>Emote sync interval (minutes)
<input
id="emote-sync-interval"
name="emote-sync-interval"
class="text-input"
type="text"
inputmode="numeric"
pattern="^[1-9]\\d*$"
placeholder="60"
/>
</label>
</div>
<p class="field-hint">Set to 60 for hourly refreshes.</p>
</div>
<div class="form-footer">
<p id="settings-status" class="status-chip">No changes yet.</p>
<button id="settings-submit-button" type="submit" class="button" disabled>