Hide all sync buttons in standalone mode, bump UI to v2.31
All sync-related buttons hidden when active server is SoulSync Standalone. Covers static buttons (querySelectorAll on status update) and dynamic modal buttons (_isSoulsyncStandalone flag). UI version bumped to 2.31 (Docker stays at 2.3).
This commit is contained in:
parent
a51e1b6651
commit
b4475152a9
3 changed files with 24 additions and 12 deletions
|
|
@ -34,7 +34,7 @@ _log_path = config_manager.get('logging.path', 'logs/app.log')
|
||||||
logger = setup_logging(_log_level, _log_path)
|
logger = setup_logging(_log_level, _log_path)
|
||||||
|
|
||||||
# App version — single source of truth for backup metadata, version-info endpoint, etc.
|
# App version — single source of truth for backup metadata, version-info endpoint, etc.
|
||||||
SOULSYNC_VERSION = "2.3"
|
SOULSYNC_VERSION = "2.31"
|
||||||
|
|
||||||
# Dedicated source reuse logger — writes to logs/source_reuse.log
|
# Dedicated source reuse logger — writes to logs/source_reuse.log
|
||||||
import logging as _logging
|
import logging as _logging
|
||||||
|
|
@ -22585,7 +22585,7 @@ def get_version_info():
|
||||||
],
|
],
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"title": "Earlier in v2.2",
|
"title": "Earlier in v2.3",
|
||||||
"description": "Major features from earlier in this release cycle",
|
"description": "Major features from earlier in this release cycle",
|
||||||
"features": [
|
"features": [
|
||||||
"• Centralized Downloads page with live-updating list and filter pills",
|
"• Centralized Downloads page with live-updating list and filter pills",
|
||||||
|
|
|
||||||
|
|
@ -3599,7 +3599,7 @@ function closeHelperSearch() {
|
||||||
// ═══════════════════════════════════════════════════════════════════════════
|
// ═══════════════════════════════════════════════════════════════════════════
|
||||||
|
|
||||||
const WHATS_NEW = {
|
const WHATS_NEW = {
|
||||||
'2.2': [
|
'2.31': [
|
||||||
// --- April 17, 2026 ---
|
// --- April 17, 2026 ---
|
||||||
{ date: 'April 17, 2026' },
|
{ date: 'April 17, 2026' },
|
||||||
{ title: 'Auto-Import', desc: 'Background staging folder watcher that automatically identifies and imports music. Three strategies: audio tags, folder name parsing, and AcoustID fingerprinting. Confidence-gated: 90%+ auto-imports, 70-90% queued for review, below 70% left for manual. Enable on the Import page Auto tab', page: 'import' },
|
{ title: 'Auto-Import', desc: 'Background staging folder watcher that automatically identifies and imports music. Three strategies: audio tags, folder name parsing, and AcoustID fingerprinting. Confidence-gated: 90%+ auto-imports, 70-90% queued for review, below 70% left for manual. Enable on the Import page Auto tab', page: 'import' },
|
||||||
|
|
@ -3695,12 +3695,12 @@ const WHATS_NEW = {
|
||||||
|
|
||||||
function _getCurrentVersion() {
|
function _getCurrentVersion() {
|
||||||
const btn = document.querySelector('.version-button');
|
const btn = document.querySelector('.version-button');
|
||||||
return btn ? btn.textContent.trim().replace('v', '') : '2.2';
|
return btn ? btn.textContent.trim().replace('v', '') : '2.31';
|
||||||
}
|
}
|
||||||
|
|
||||||
function _getLatestWhatsNewVersion() {
|
function _getLatestWhatsNewVersion() {
|
||||||
const versions = Object.keys(WHATS_NEW).sort((a, b) => parseFloat(b) - parseFloat(a));
|
const versions = Object.keys(WHATS_NEW).sort((a, b) => parseFloat(b) - parseFloat(a));
|
||||||
return versions[0] || '2.2';
|
return versions[0] || '2.31';
|
||||||
}
|
}
|
||||||
|
|
||||||
function openWhatsNew() {
|
function openWhatsNew() {
|
||||||
|
|
|
||||||
|
|
@ -396,9 +396,15 @@ function handleServiceStatusUpdate(data) {
|
||||||
// Update downloads nav badge from status push
|
// Update downloads nav badge from status push
|
||||||
if (data.active_downloads !== undefined) _updateDlNavBadge(data.active_downloads);
|
if (data.active_downloads !== undefined) _updateDlNavBadge(data.active_downloads);
|
||||||
|
|
||||||
// Hide sync nav button for standalone mode (no server to sync playlists to)
|
// Hide sync-related UI for standalone mode (no server to sync playlists to)
|
||||||
|
const isSoulsyncStandalone = data.media_server?.type === 'soulsync';
|
||||||
|
_isSoulsyncStandalone = isSoulsyncStandalone;
|
||||||
const syncNav = document.querySelector('[data-page="sync"]');
|
const syncNav = document.querySelector('[data-page="sync"]');
|
||||||
if (syncNav) syncNav.style.display = (data.media_server?.type === 'soulsync') ? 'none' : '';
|
if (syncNav) syncNav.style.display = isSoulsyncStandalone ? 'none' : '';
|
||||||
|
// Hide all sync buttons across the app
|
||||||
|
document.querySelectorAll('.sync-to-server-btn, [id$="-sync-btn"], [onclick*="startPlaylistSync"], [onclick*="syncPlaylistToServer"], [onclick*="startDecadeSync"]').forEach(btn => {
|
||||||
|
btn.style.display = isSoulsyncStandalone ? 'none' : '';
|
||||||
|
});
|
||||||
|
|
||||||
// Update enrichment service cards
|
// Update enrichment service cards
|
||||||
if (data.enrichment) renderEnrichmentCards(data.enrichment);
|
if (data.enrichment) renderEnrichmentCards(data.enrichment);
|
||||||
|
|
@ -11839,7 +11845,7 @@ function showPlaylistDetailsModal(playlist) {
|
||||||
? '📊 View Download Results'
|
? '📊 View Download Results'
|
||||||
: '📥 Download Missing Tracks'}
|
: '📥 Download Missing Tracks'}
|
||||||
</button>
|
</button>
|
||||||
<button id="sync-btn-${playlist.id}" class="playlist-modal-btn playlist-modal-btn-primary" onclick="startPlaylistSync('${playlist.id}')" ${isSyncing ? 'disabled' : ''}>${isSyncing ? '⏳ Syncing...' : 'Sync Playlist'}</button>
|
<button id="sync-btn-${playlist.id}" class="playlist-modal-btn playlist-modal-btn-primary" onclick="startPlaylistSync('${playlist.id}')" ${isSyncing ? 'disabled' : ''} ${_isSoulsyncStandalone ? 'style="display:none"' : ''}>${isSyncing ? '⏳ Syncing...' : 'Sync Playlist'}</button>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
`;
|
`;
|
||||||
|
|
@ -25417,6 +25423,7 @@ function updateLibraryStatusCard(dbStats) {
|
||||||
|
|
||||||
// Track last service status for library card
|
// Track last service status for library card
|
||||||
let _lastServiceStatus = null;
|
let _lastServiceStatus = null;
|
||||||
|
let _isSoulsyncStandalone = false; // Global flag: true when no media server (sync buttons hidden)
|
||||||
const _origFetchServiceStatus = typeof fetchAndUpdateServiceStatus === 'function' ? fetchAndUpdateServiceStatus : null;
|
const _origFetchServiceStatus = typeof fetchAndUpdateServiceStatus === 'function' ? fetchAndUpdateServiceStatus : null;
|
||||||
|
|
||||||
function _capitalize(s) { return s ? s.charAt(0).toUpperCase() + s.slice(1) : ''; }
|
function _capitalize(s) { return s ? s.charAt(0).toUpperCase() + s.slice(1) : ''; }
|
||||||
|
|
@ -27581,7 +27588,7 @@ function showDeezerArlPlaylistDetailsModal(playlist, originalDeezerPlaylistId) {
|
||||||
<button class="playlist-modal-btn playlist-modal-btn-tertiary" onclick="closeDeezerArlPlaylistDetailsModal(); openDownloadMissingModal('${playlistId}')">
|
<button class="playlist-modal-btn playlist-modal-btn-tertiary" onclick="closeDeezerArlPlaylistDetailsModal(); openDownloadMissingModal('${playlistId}')">
|
||||||
${hasCompletedProcess ? '📊 View Download Results' : '📥 Download Missing Tracks'}
|
${hasCompletedProcess ? '📊 View Download Results' : '📥 Download Missing Tracks'}
|
||||||
</button>
|
</button>
|
||||||
<button id="sync-btn-${playlistId}" class="playlist-modal-btn playlist-modal-btn-primary" onclick="startPlaylistSync('${playlistId}')" ${isSyncing ? 'disabled' : ''}>${isSyncing ? '⏳ Syncing...' : 'Sync Playlist'}</button>
|
<button id="sync-btn-${playlistId}" class="playlist-modal-btn playlist-modal-btn-primary" onclick="startPlaylistSync('${playlistId}')" ${isSyncing ? 'disabled' : ''} ${_isSoulsyncStandalone ? 'style="display:none"' : ''}>${isSyncing ? '⏳ Syncing...' : 'Sync Playlist'}</button>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
`;
|
`;
|
||||||
|
|
@ -37227,7 +37234,7 @@ async function openDownloadMissingModalForArtistAlbum(virtualPlaylistId, playlis
|
||||||
Begin Analysis
|
Begin Analysis
|
||||||
</button>
|
</button>
|
||||||
${_isBeatportPlaylistId(virtualPlaylistId) ? `
|
${_isBeatportPlaylistId(virtualPlaylistId) ? `
|
||||||
<button class="download-control-btn sync-to-server-btn" id="sync-server-btn-${virtualPlaylistId}" onclick="syncPlaylistToServer('${virtualPlaylistId}')">
|
<button class="download-control-btn sync-to-server-btn" id="sync-server-btn-${virtualPlaylistId}" onclick="syncPlaylistToServer('${virtualPlaylistId}')" ${_isSoulsyncStandalone ? 'style="display:none"' : ''}>
|
||||||
Sync to Server
|
Sync to Server
|
||||||
</button>` : ''}
|
</button>` : ''}
|
||||||
<button class="download-control-btn" id="add-to-wishlist-btn-${virtualPlaylistId}" onclick="addModalTracksToWishlist('${virtualPlaylistId}')" style="background-color: #9333ea; color: white;">
|
<button class="download-control-btn" id="add-to-wishlist-btn-${virtualPlaylistId}" onclick="addModalTracksToWishlist('${virtualPlaylistId}')" style="background-color: #9333ea; color: white;">
|
||||||
|
|
@ -39257,9 +39264,14 @@ async function fetchAndUpdateServiceStatus() {
|
||||||
// Update downloads nav badge
|
// Update downloads nav badge
|
||||||
if (data.active_downloads !== undefined) _updateDlNavBadge(data.active_downloads);
|
if (data.active_downloads !== undefined) _updateDlNavBadge(data.active_downloads);
|
||||||
|
|
||||||
// Hide sync nav for standalone mode
|
// Hide sync-related UI for standalone mode
|
||||||
|
const isSoulsyncStandalone2 = data.media_server?.type === 'soulsync';
|
||||||
|
_isSoulsyncStandalone = isSoulsyncStandalone2;
|
||||||
const syncNav = document.querySelector('[data-page="sync"]');
|
const syncNav = document.querySelector('[data-page="sync"]');
|
||||||
if (syncNav) syncNav.style.display = (data.media_server?.type === 'soulsync') ? 'none' : '';
|
if (syncNav) syncNav.style.display = isSoulsyncStandalone2 ? 'none' : '';
|
||||||
|
document.querySelectorAll('.sync-to-server-btn, [id$="-sync-btn"], [onclick*="startPlaylistSync"], [onclick*="syncPlaylistToServer"], [onclick*="startDecadeSync"]').forEach(btn => {
|
||||||
|
btn.style.display = isSoulsyncStandalone2 ? 'none' : '';
|
||||||
|
});
|
||||||
|
|
||||||
// Update enrichment service cards
|
// Update enrichment service cards
|
||||||
if (data.enrichment) renderEnrichmentCards(data.enrichment);
|
if (data.enrichment) renderEnrichmentCards(data.enrichment);
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue