[WIP] proof of concept ListenBrainz compatible API
fork

Configure Feed

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

fail with no listen_at

+4
+4
src/index.ts
··· 206 206 app.post("/lbz/1/submit-listens", async (c: Context) => { 207 207 console.log("/lbz/1/submit-listens"); 208 208 const body: LBZRequest = await c.req.json(); 209 + console.log("body", JSON.stringify(body)); 209 210 const token = c.req.header("Authorization")?.split("Token ")[1]; 210 211 if (!token) { 211 212 return c.json({ error: "Missing token" }, 401); ··· 226 227 227 228 for (const listen of body.payload) { 228 229 const { track_name, artist_name, release_name } = listen.track_metadata; 230 + if (!listen.listened_at) { 231 + return c.json({ error: "Missing listened_at" }, 400); 232 + } 229 233 230 234 // Build query for MusicBrainz 231 235 const queryParts: string[] = [];