chore: scrobbling
This commit is contained in:
parent
d3f7ac8533
commit
891a4ade02
1 changed files with 3 additions and 2 deletions
|
@ -101,8 +101,7 @@ export default async (request) => {
|
||||||
|
|
||||||
// scrobble logic
|
// scrobble logic
|
||||||
artistInfo = await artists.get(artistKey, { type: 'json'})
|
artistInfo = await artists.get(artistKey, { type: 'json'})
|
||||||
console.log(artistInfo)
|
console.log('artistInfo', artistInfo)
|
||||||
console.log(typeof artistInfo)
|
|
||||||
const artistUrl = `https://musicbrainz.org/artist/${artistInfo?.['mbid']}`
|
const artistUrl = `https://musicbrainz.org/artist/${artistInfo?.['mbid']}`
|
||||||
const trackScrobbleData = {
|
const trackScrobbleData = {
|
||||||
track,
|
track,
|
||||||
|
@ -119,9 +118,11 @@ export default async (request) => {
|
||||||
let windowUpdate = windowData;
|
let windowUpdate = windowData;
|
||||||
console.log('### SCROBBLE')
|
console.log('### SCROBBLE')
|
||||||
console.log(scrobbleUpdate)
|
console.log(scrobbleUpdate)
|
||||||
|
console.log('scrobbleUpdate["data"].length', scrobbleUpdate["data"].length)
|
||||||
console.log('### SCROBBLE')
|
console.log('### SCROBBLE')
|
||||||
console.log('### WINDOW')
|
console.log('### WINDOW')
|
||||||
console.log(windowUpdate)
|
console.log(windowUpdate)
|
||||||
|
console.log('windowUpdate["data"].length', windowUpdate["data"].length)
|
||||||
console.log('### WINDOW')
|
console.log('### WINDOW')
|
||||||
if (scrobbleUpdate['data']) scrobbleUpdate['data'].push(trackScrobbleData)
|
if (scrobbleUpdate['data']) scrobbleUpdate['data'].push(trackScrobbleData)
|
||||||
if (!scrobbleUpdate['data']) scrobbleUpdate = { data: [trackScrobbleData] }
|
if (!scrobbleUpdate['data']) scrobbleUpdate = { data: [trackScrobbleData] }
|
||||||
|
|
Reference in a new issue