(strip, nonTrash)
| 1207 | } |
| 1208 | |
| 1209 | function renderStrip(strip, nonTrash) { |
| 1210 | if (!strip) return; |
| 1211 | const folderTrackIds = new Set(folders.flatMap((folder) => folder.items)); |
| 1212 | for (const [trackId, track] of Object.entries(tracks)) { |
| 1213 | if (folderTrackIds.has(trackId)) continue; |
| 1214 | strip.appendChild(makeStripItem({ |
| 1215 | className: trackId === _currentTrackId ? "active" : "", |
| 1216 | id: trackId, |
| 1217 | title: track.title, |
| 1218 | html: thumbHtml(track), |
| 1219 | trackId, |
| 1220 | })); |
| 1221 | } |
| 1222 | for (const folder of nonTrash) { |
| 1223 | const folderColor = normalizeFolderColor(folder.color); |
| 1224 | strip.appendChild(makeStripItem({ |
| 1225 | className: "folder-thumb", |
| 1226 | id: folder.id, |
| 1227 | title: `${folder.name} (${folder.items.length})`, |
| 1228 | html: folderThumbHtml(false), |
| 1229 | color: folderColor, |
| 1230 | })); |
| 1231 | } |
| 1232 | } |
| 1233 | |
| 1234 | function render() { |
| 1235 | const list = document.getElementById("catalogList"); |
no test coverage detected