UI polish: refresh button, negative thumbnail cache, and style fixes
- Add refresh button to browser toolbar to re-fetch current folder - Cache "no thumbnail" results to avoid repeated slow SMB lookups - Fix list view fallback icon sizing for files without album art - Fix view toggle button hover (no background/scale on hover) - Skip re-render when clicking already-active view mode button Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
@@ -1873,11 +1873,16 @@ async function loadThumbnail(imgElement, fileName) {
|
||||
} else {
|
||||
// Fallback to icon (204 = no thumbnail available)
|
||||
const parent = imgElement.parentElement;
|
||||
const isList = parent.classList.contains('browser-list-icon');
|
||||
imgElement.remove();
|
||||
const icon = document.createElement('div');
|
||||
icon.className = 'browser-icon';
|
||||
icon.textContent = '🎵';
|
||||
parent.insertBefore(icon, parent.firstChild);
|
||||
if (isList) {
|
||||
parent.textContent = '🎵';
|
||||
} else {
|
||||
const icon = document.createElement('div');
|
||||
icon.className = 'browser-icon';
|
||||
icon.textContent = '🎵';
|
||||
parent.insertBefore(icon, parent.firstChild);
|
||||
}
|
||||
}
|
||||
} catch (error) {
|
||||
console.error('Error loading thumbnail:', error);
|
||||
@@ -2008,7 +2013,16 @@ function nextPage() {
|
||||
}
|
||||
}
|
||||
|
||||
function refreshBrowser() {
|
||||
if (currentFolderId) {
|
||||
browsePath(currentFolderId, currentPath, currentOffset);
|
||||
} else {
|
||||
loadMediaFolders();
|
||||
}
|
||||
}
|
||||
|
||||
function setViewMode(mode) {
|
||||
if (mode === viewMode) return;
|
||||
viewMode = mode;
|
||||
localStorage.setItem('mediaBrowser.viewMode', mode);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user