chore: scrobbling

This commit is contained in:
Cory Dransfeldt 2024-03-29 12:07:04 -07:00
parent 2251eb087b
commit f4d1e621bc
No known key found for this signature in database

View file

@ -57,9 +57,9 @@ export default async (request, context) => {
console.log(err);
return {}
});
const track = trackRes["recenttracks"]["track"][0];
const trackData = trackRes["recenttracks"]["track"][0];
let mbid = trackRes['track']['artist']['mbid']
const mbidMap = () => mbidRes[track["artist"]["#text"].toLowerCase()] || "";
const mbidMap = () => mbidRes[trackData['artist']['#text'].toLowerCase()] || "";
// mbid mismatches
if (mbidMap() !== "") mbid = mbidMap();