Files
voxpop-backend/Track.js
2021-09-08 07:44:54 +02:00

28 lines
454 B
JavaScript

class Track {
constructor(data) {
console.log(data)
this.id = data.id
this.title = data.name
this.artists = data.artists.map((a) => a.name)
this.album = {
name: data.album.name,
art: data.album.images[0].url,
year: data.album.release_date.slice(0, 4),
}
this.duration = data.duration_ms
this.explicit = data.explicit
this.banned = false
this.votes = {
up: 100,
down: 50,
rank: 1,
}
}
}
export default Track