({ title, thumbnail, key, bpm, stemCount } = {})
| 1236 | } |
| 1237 | |
| 1238 | export function updateFooterTrack({ title, thumbnail, key, bpm, stemCount } = {}) { |
| 1239 | if (footerThumb) { |
| 1240 | const artEl = footerThumb.closest(".footer-art"); |
| 1241 | if (thumbnail) { |
| 1242 | footerThumb.src = thumbnail; |
| 1243 | footerThumb.onload = () => { |
| 1244 | footerThumb.classList.add("loaded"); |
| 1245 | artEl?.classList.add("has-art"); |
| 1246 | }; |
| 1247 | footerThumb.onerror = () => { |
| 1248 | footerThumb.classList.remove("loaded"); |
| 1249 | artEl?.classList.remove("has-art"); |
| 1250 | }; |
| 1251 | } else { |
| 1252 | footerThumb.removeAttribute("src"); |
| 1253 | footerThumb.classList.remove("loaded"); |
| 1254 | artEl?.classList.remove("has-art"); |
| 1255 | } |
| 1256 | } |
| 1257 | if (footerTitle && title !== undefined) footerTitle.textContent = title; |
| 1258 | if (footerMeta) { |
| 1259 | const parts = []; |
| 1260 | if (key) parts.push(key); |
| 1261 | if (bpm) parts.push(`${Math.round(bpm)} BPM`); |
| 1262 | if (stemCount != null) parts.push(`${stemCount} Stems`); |
| 1263 | if (key !== undefined || bpm !== undefined || stemCount !== undefined) |
| 1264 | footerMeta.textContent = parts.join(" • "); |
| 1265 | } |
| 1266 | } |
| 1267 | |
| 1268 | function _triggerDownload(url, filename) { |
| 1269 | const fullUrl = url.startsWith("http") ? url : `${location.origin}${url}`; |
no outgoing calls
no test coverage detected