Something went wrong. Try again.
A decentralized music tracking and discovery platform built on AT Protocol 🎵 rocksky.app
spotify atproto lastfm musicbrainz scrobbling listenbrainz
Something went wrong. Try again.
12345678910111213141516171819export function dedupeTracksKeepLyrics(tracks) { const trackMap = new Map();
for (const track of tracks) { const key = `${track.disc_number} - ${track.track_number}`;
if (!key) continue;
const existing = trackMap.get(key);
// If current has lyrics and either no existing or existing has no lyrics, replace it if (!existing || (!existing.lyrics && track.lyrics)) { trackMap.set(key, track); } }
return Array.from(trackMap.values());}