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

Run initial sync on scrobble API startup

+8
+8
apps/cli/src/cmd/scrobble-api.ts
··· 11 11 import _ from "lodash"; 12 12 import { publishScrobble } from "scrobble"; 13 13 import { validateLastfmSignature } from "lib/lastfm"; 14 + import { sync } from "./sync"; 14 15 15 16 export async function scrobbleApi({ port }) { 16 17 const [, handle] = await getDidAndHandle(); ··· 453 454 454 455 log.info`lastfm/listenbrainz/webscrobbler scrobble API listening on ${"http://localhost:" + port}`; 455 456 457 + new Promise(async () => { 458 + try { 459 + await sync(); 460 + } catch (err) { 461 + log.warn`Error during initial sync: ${err}`; 462 + } 463 + }); 456 464 serve({ fetch: app.fetch, port }); 457 465 }