tangled
alpha
login
or
join now
rocksky.app
/
rocksky
96
fork
atom
A decentralized music tracking and discovery platform built on AT Protocol 🎵
rocksky.app
spotify
atproto
lastfm
musicbrainz
scrobbling
listenbrainz
96
fork
atom
overview
issues
7
pulls
pipelines
Run initial sync on scrobble API startup
tsiry-sandratraina.com
1 month ago
bb99ad74
3576bd98
+8
1 changed file
expand all
collapse all
unified
split
apps
cli
src
cmd
scrobble-api.ts
+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
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
457
+
new Promise(async () => {
458
458
+
try {
459
459
+
await sync();
460
460
+
} catch (err) {
461
461
+
log.warn`Error during initial sync: ${err}`;
462
462
+
}
463
463
+
});
456
464
serve({ fetch: app.fetch, port });
457
465
}