A decentralized music tracking and discovery platform built on AT Protocol 馃幍 rocksky.app
spotify atproto lastfm musicbrainz scrobbling listenbrainz
97
fork

Configure Feed

Select the types of activity you want to include in your feed.

at feat/pgpull 18 lines 477 B view raw
1export function dedupeTracksKeepLyrics(tracks) { 2 const trackMap = new Map(); 3 4 for (const track of tracks) { 5 const key = `${track.disc_number} - ${track.track_number}`; 6 7 if (!key) continue; 8 9 const existing = trackMap.get(key); 10 11 // If current has lyrics and either no existing or existing has no lyrics, replace it 12 if (!existing || (!existing.lyrics && track.lyrics)) { 13 trackMap.set(key, track); 14 } 15 } 16 17 return Array.from(trackMap.values()); 18}