chore: last played track to now page
This commit is contained in:
parent
d9fdcad1f1
commit
d9c148d08c
4 changed files with 7 additions and 11 deletions
|
@ -7,7 +7,7 @@ const sanitizeMediaString = (string) => string.normalize('NFD').replace(/[\u0300
|
|||
|
||||
export const mbidMap = (artist) => mbidPatches[artist.toLowerCase()] || ''
|
||||
|
||||
export const buildChart = (tracks, artists, albums) => {
|
||||
export const buildChart = (tracks, artists, albums, nowPlaying) => {
|
||||
const artistsData = {}
|
||||
const albumsData = {}
|
||||
const tracksData = {}
|
||||
|
@ -63,5 +63,6 @@ export const buildChart = (tracks, artists, albums) => {
|
|||
artists: objectToArraySorted(artistsData),
|
||||
albums: objectToArraySorted(albumsData),
|
||||
tracks: objectToArraySorted(tracksData),
|
||||
nowPlaying
|
||||
}
|
||||
}
|
|
@ -9,5 +9,5 @@ export default async function () {
|
|||
type: 'json',
|
||||
}).catch();
|
||||
const resObj = await res;
|
||||
return buildChart(resObj['scrobbles'], resObj['artists'], resObj['albums'])
|
||||
return buildChart(resObj['scrobbles'], resObj['artists'], resObj['albums'], resObj['nowPlaying'])
|
||||
}
|
||||
|
|
Reference in a new issue