chore: scrobbling
This commit is contained in:
parent
eebda14a41
commit
ac6e58bb09
1 changed files with 4 additions and 4 deletions
|
@ -116,10 +116,10 @@ export default async (request) => {
|
|||
await scrobbles.setJSON('now-playing', JSON.stringify(trackScrobbleData))
|
||||
let scrobbleUpdate = scrobbleData
|
||||
let windowUpdate = windowData;
|
||||
if (scrobbleUpdate) scrobbleUpdate['data'].push(trackScrobbleData)
|
||||
if (!scrobbleUpdate) scrobbleUpdate = { data: [trackScrobbleData] }
|
||||
if (windowData) windowUpdate['data'].push(trackScrobbleData)
|
||||
if (!windowData) windowUpdate = { data: [trackScrobbleData] }
|
||||
if (scrobbleUpdate['data']) scrobbleUpdate['data'].push(trackScrobbleData)
|
||||
if (!scrobbleUpdate['data']) scrobbleUpdate = { data: [trackScrobbleData] }
|
||||
if (windowData['data']) windowUpdate['data'].push(trackScrobbleData)
|
||||
if (!windowData['data']) windowUpdate = { data: [trackScrobbleData] }
|
||||
await scrobbles.setJSON(`${weekStop()}`, JSON.stringify(scrobbleUpdate))
|
||||
await scrobbles.setJSON('window', JSON.stringify(filterOldScrobbles(windowUpdate.data)))
|
||||
}
|
||||
|
|
Reference in a new issue