A decentralized music tracking and discovery platform built on AT Protocol 🎵

[api] publish track on scrobble

+14 -1
+9
apps/api/src/nowplaying/nowplaying.service.ts
··· 350 350 }); 351 351 352 352 ctx.nc.publish("rocksky.scrobble", Buffer.from(message)); 353 + 354 + const trackMessage = JSON.stringify({ 355 + track: scrobble.track_id, 356 + album_track, 357 + artist_track, 358 + artist_album, 359 + }); 360 + 361 + ctx.nc.publish("rocksky.track", Buffer.from(trackMessage)); 353 362 } 354 363 355 364 export async function scrobbleTrack(
+5 -1
apps/web/src/hooks/useProfile.tsx
··· 64 64 useEffect(() => { 65 65 if (data !== "Unauthorized" && data !== "Internal Server Error" && data) { 66 66 const profile = JSON.parse(data); 67 + if (Object.keys(profile).length === 0) { 68 + localStorage.removeItem("token"); 69 + window.location.href = "/"; 70 + return; 71 + } 67 72 setProfile({ 68 73 avatar: profile.avatar, 69 74 displayName: profile.displayName, ··· 84 89 85 90 if ( 86 91 !data || 87 - Object.keys(data).length === 0 || 88 92 data === "Unauthorized" || 89 93 data === "Internal Server Error" || 90 94 (error && localStorage.getItem("token"))