gfsd
This commit is contained in:
@@ -532,14 +532,32 @@
|
||||
else if (rClass === 'sfw' && blurSfw) isBlurred = true;
|
||||
else if (rClass === 'untagged' && blurUntagged) isBlurred = true;
|
||||
|
||||
let thumbUrl = `/t/${c.item_id}.webp`;
|
||||
const mime = c.mime || c.item_mime || '';
|
||||
const activeDest = c.item_dest || c.dest || '';
|
||||
const isAudio = mime.startsWith('audio/') || (!mime && activeDest.match(/\.(mp3|wav|ogg|flac|m4a|aac|opus)$/i));
|
||||
|
||||
let thumbUrl = c.thumb || `/t/${c.item_id}.webp`;
|
||||
if (isBlurred) {
|
||||
thumbUrl = `/t/${c.item_id}_blur.webp`;
|
||||
const baseThumb = thumbUrl.replace(/\.webp$/, '');
|
||||
thumbUrl = `${baseThumb}_blur.webp`;
|
||||
}
|
||||
|
||||
if (window.applyThumbCacheBust) thumbUrl = window.applyThumbCacheBust(thumbUrl);
|
||||
|
||||
mediaHtml = `<img src="${thumbUrl}" style="width: 32px; height: 32px; object-fit: cover; border-radius: 2px;" loading="lazy" onerror="this.style.display='none'" />`;
|
||||
if (isAudio && !c.has_coverart) {
|
||||
mediaHtml = `
|
||||
<div class="sidebar-media-placeholder audio">
|
||||
<i class="fa-solid fa-music"></i>
|
||||
</div>
|
||||
`;
|
||||
} else {
|
||||
mediaHtml = `
|
||||
<img src="${thumbUrl}" style="width: 32px; height: 32px; object-fit: cover; border-radius: 2px;" loading="lazy" onerror="this.style.display='none'; if(this.nextElementSibling) this.nextElementSibling.classList.remove('hidden');" />
|
||||
<div class="sidebar-media-placeholder ${isAudio ? 'audio' : ''} hidden">
|
||||
<i class="${isAudio ? 'fa-solid fa-music' : 'fa-solid fa-image'}"></i>
|
||||
</div>
|
||||
`;
|
||||
}
|
||||
|
||||
itemPreview = `
|
||||
<div class="item-preview">
|
||||
@@ -1869,6 +1887,7 @@
|
||||
}
|
||||
}
|
||||
};
|
||||
window.switchSidebarTab = switchSidebarTab;
|
||||
|
||||
const initSidebarTabs = () => {
|
||||
const tabsContainer = document.querySelector('.sidebar-tabs');
|
||||
|
||||
Reference in New Issue
Block a user