Fix settings persistence: ReplayGain Pre-Amp and Gapless Playback
This commit is contained in:
parent
6b1619d2c3
commit
a18e865906
4 changed files with 36 additions and 28 deletions
25
.env.example
25
.env.example
|
|
@ -1,25 +0,0 @@
|
|||
# Monochrome Docker Configuration
|
||||
# Copy to .env and edit: cp .env.example .env
|
||||
|
||||
# Monochrome
|
||||
MONOCHROME_PORT=3000
|
||||
MONOCHROME_DEV_PORT=5173
|
||||
|
||||
# Auth Gate (server-side authentication)
|
||||
# Set AUTH_ENABLED=true to enable the auth gate entirely (login required)
|
||||
AUTH_ENABLED=false
|
||||
AUTH_SECRET=change-me-to-a-random-string
|
||||
APPWRITE_ENDPOINT=https://auth.yourdomain.com/v1
|
||||
APPWRITE_PROJECT_ID=auth-for-monochrome
|
||||
# Optional: toggle login providers (defaults to true when unset)
|
||||
# AUTH_GOOGLE_ENABLED=true
|
||||
# AUTH_EMAIL_ENABLED=true
|
||||
# Optional: set PocketBase URL (hides the field in settings when set)
|
||||
# POCKETBASE_URL=https://data.samidy.xyz
|
||||
# SESSION_MAX_AGE=604800000 # 7 days in ms (default)
|
||||
|
||||
# PocketBase (only used with --profile pocketbase)
|
||||
POCKETBASE_PORT=8090
|
||||
PB_ADMIN_EMAIL=admin@example.com
|
||||
PB_ADMIN_PASSWORD=changeme
|
||||
TZ=UTC
|
||||
13
index.html
13
index.html
|
|
@ -690,8 +690,15 @@
|
|||
<div id="jspf-import-panel" class="import-panel" style="display: none">
|
||||
<p style="margin-bottom: 0.5rem; font-size: 0.9rem">Import from JSPF</p>
|
||||
<p style="font-size: 0.8rem; margin: 0">
|
||||
JSPF (JSON Shareable Playlist Format) is supported by ListenBrainz and other services.
|
||||
Import playlists with rich metadata including MusicBrainz identifiers.
|
||||
JSPF (JSON Shareable Playlist Format) is supported by const replayGainPreamp = document.getElementById('replay-gain-preamp');
|
||||
if (replayGainPreamp) {
|
||||
replayGainPreamp.value = replayGainSettings.getPreamp();
|
||||
replayGainPreamp.addEventListener('change', (e) => {
|
||||
const val = parseFloat(e.target.value);
|
||||
replayGainSettings.setPreamp(isNaN(val) ? 3 : val);
|
||||
player.applyReplayGain();
|
||||
});
|
||||
} Import playlists with rich metadata including MusicBrainz identifiers.
|
||||
</p>
|
||||
<br />
|
||||
<input
|
||||
|
|
@ -4733,7 +4740,7 @@
|
|||
<span class="description">Play audio without interruption between tracks</span>
|
||||
</div>
|
||||
<label class="toggle-switch">
|
||||
<input type="checkbox" checked />
|
||||
<input type="checkbox" id="gapless-playback-toggle" checked />
|
||||
<span class="slider"></span>
|
||||
</label>
|
||||
</div>
|
||||
|
|
|
|||
|
|
@ -32,6 +32,7 @@ import {
|
|||
pwaUpdateSettings,
|
||||
contentBlockingSettings,
|
||||
musicProviderSettings,
|
||||
gaplessPlaybackSettings,
|
||||
analyticsSettings,
|
||||
modalSettings,
|
||||
} from './storage.js';
|
||||
|
|
@ -980,6 +981,14 @@ export function initializeSettings(scrobbler, player, api, ui) {
|
|||
});
|
||||
}
|
||||
|
||||
const gaplessPlaybackToggle = document.getElementById('gapless-playback-toggle');
|
||||
if (gaplessPlaybackToggle) {
|
||||
gaplessPlaybackToggle.checked = gaplessPlaybackSettings.isEnabled();
|
||||
gaplessPlaybackToggle.addEventListener('change', (e) => {
|
||||
gaplessPlaybackSettings.setEnabled(e.target.checked);
|
||||
});
|
||||
}
|
||||
|
||||
// ReplayGain Settings
|
||||
const replayGainMode = document.getElementById('replay-gain-mode');
|
||||
if (replayGainMode) {
|
||||
|
|
|
|||
|
|
@ -488,6 +488,23 @@ export const nowPlayingSettings = {
|
|||
},
|
||||
};
|
||||
|
||||
export const gaplessPlaybackSettings = {
|
||||
STORAGE_KEY: 'gapless-playback-enabled',
|
||||
|
||||
isEnabled() {
|
||||
try {
|
||||
const val = localStorage.getItem(this.STORAGE_KEY);
|
||||
return val === null ? true : val === 'true';
|
||||
} catch {
|
||||
return true;
|
||||
}
|
||||
},
|
||||
|
||||
setEnabled(enabled) {
|
||||
localStorage.setItem(this.STORAGE_KEY, enabled ? 'true' : 'false');
|
||||
},
|
||||
};
|
||||
|
||||
export const fullscreenCoverClickSettings = {
|
||||
STORAGE_KEY: 'fullscreen-cover-click-action',
|
||||
|
||||
|
|
|
|||
Loading…
Reference in a new issue