(track)
| 136 | } |
| 137 | |
| 138 | function trackMatchesSearch(track) { |
| 139 | const q = normalizeSearch(catalogSearchQuery); |
| 140 | if (!q) return true; |
| 141 | if (q.startsWith("#")) { |
| 142 | const tag = q.slice(1); |
| 143 | if (!tag) return true; |
| 144 | return (track?.tags ?? []).some((t) => String(t).toLowerCase().includes(tag)); |
| 145 | } |
| 146 | return [ |
| 147 | track?.title, |
| 148 | track?.channel, |
| 149 | track?.sourceUrl, |
| 150 | ...(track?.stems || []), |
| 151 | ...(track?.tags || []), |
| 152 | ].some((value) => String(value || "").toLowerCase().includes(q)); |
| 153 | } |
| 154 | |
| 155 | function findTrackBySource(sourceUrl, exceptId) { |
| 156 | const source = normalizeSource(sourceUrl); |
no test coverage detected