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

Configure Feed

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

fix issue with retryFetchScrobble function

+5 -4
+5 -4
rockskyapi/rocksky-auth/src/xrpc/app/rocksky/scrobble/createScrobble.ts
··· 20 20 import tables from "schema"; 21 21 import { SelectAlbum } from "schema/albums"; 22 22 import { SelectArtist } from "schema/artists"; 23 + import { SelectScrobble } from "schema/scrobbles"; 23 24 import { SelectTrack } from "schema/tracks"; 24 25 import { InsertUserAlbum } from "schema/user-albums"; 25 26 import { InsertUserArtist } from "schema/user-artists"; ··· 292 293 ) 293 294 ); 294 295 295 - const getScrobbles = ({ ctx, id }: { ctx: Context; id: string }) => 296 + const getScrobble = ({ ctx, id }: { ctx: Context; id: string }) => 296 297 Effect.tryPromise(() => 297 298 ctx.db 298 299 .select() ··· 522 523 const publishScrobble = (ctx: Context, id: string) => 523 524 pipe( 524 525 { ctx, id }, 525 - getScrobbles, 526 + getScrobble, 526 527 Effect.flatMap((scrobble) => 527 528 pipe( 528 529 Effect.all([ ··· 991 992 albums?: SelectAlbum; 992 993 artists?: SelectArtist; 993 994 users?: SelectUser; 994 - id?: string; 995 + srcobbles?: SelectScrobble; 995 996 } | null, 996 997 }, 997 998 { ··· 1153 1154 scrobble.tracks.artistUri && 1154 1155 scrobble.tracks.albumUri 1155 1156 ? pipe( 1156 - publishScrobble(ctx, scrobble.id), 1157 + publishScrobble(ctx, scrobble.srcobbles?.id), 1157 1158 Effect.tap(() => 1158 1159 Effect.logInfo("Scrobble published") 1159 1160 )