(sourceUrl, exceptId)
| 153 | } |
| 154 | |
| 155 | function findTrackBySource(sourceUrl, exceptId) { |
| 156 | const source = normalizeSource(sourceUrl); |
| 157 | if (!source) return null; |
| 158 | for (const [id, track] of Object.entries(tracks)) { |
| 159 | if (id === exceptId) continue; |
| 160 | if (normalizeSource(track.sourceUrl) === source) return id; |
| 161 | } |
| 162 | return null; |
| 163 | } |
| 164 | |
| 165 | function replaceTrackId(oldId, newId) { |
| 166 | if (!oldId || !newId || oldId === newId || !tracks[oldId]) return; |
no test coverage detected