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

refactor: fix formatting issues and improve error handling in avatar script

+3 -3
+3 -3
apps/api/src/scripts/avatar.ts
··· 18 } 19 20 const plc = await fetch(`https://plc.directory/${user.did}`).then((res) => 21 - res.json(), 22 ); 23 24 const serviceEndpoint = _.get(plc, "service.0.serviceEndpoint"); ··· 28 } 29 30 const profile = await fetch( 31 - `${serviceEndpoint}/xrpc/com.atproto.repo.getRecord?repo=${user.did}&collection=app.bsky.actor.profile&rkey=self`, 32 ).then((res) => res.json()); 33 const ref = _.get(profile, "value.avatar.ref.$link"); 34 - const type = _.get(profile, "value.avatar.mimeType").split("/")[1]; 35 await ctx.db 36 .update(users) 37 .set({
··· 18 } 19 20 const plc = await fetch(`https://plc.directory/${user.did}`).then((res) => 21 + res.json() 22 ); 23 24 const serviceEndpoint = _.get(plc, "service.0.serviceEndpoint"); ··· 28 } 29 30 const profile = await fetch( 31 + `${serviceEndpoint}/xrpc/com.atproto.repo.getRecord?repo=${user.did}&collection=app.bsky.actor.profile&rkey=self` 32 ).then((res) => res.json()); 33 const ref = _.get(profile, "value.avatar.ref.$link"); 34 + const type = _.get(profile, "value.avatar.mimeType", "").split("/")[1]; 35 await ctx.db 36 .update(users) 37 .set({