Skip to content

Commit

Permalink
Merge pull request #6 from music10/20210105
Browse files Browse the repository at this point in the history
hotgix
  • Loading branch information
dergunovd authored Jan 5, 2021
2 parents 0f08a90 + a83a839 commit 69611f9
Showing 1 changed file with 8 additions and 6 deletions.
14 changes: 8 additions & 6 deletions src/modules/api/spotify/api.service.ts
Original file line number Diff line number Diff line change
Expand Up @@ -107,12 +107,14 @@ export class ApiService implements MusicApi {
return new Promise<Track[]>((resolve) => {
const responseHandler = ({ data }) => {
tracks.push(
...data.items.map(({ track }) => ({
name: track.name,
id: track.id,
author: track.artists.map((artist) => artist.name).join(', '),
mp3: track.preview_url,
})),
...data.items
.filter(({ track }) => track.preview_url)
.map(({ track }) => ({
name: track.name,
id: track.id,
author: track.artists.map((artist) => artist.name).join(', '),
mp3: track.preview_url,
})),
);

if (data.next) {
Expand Down

0 comments on commit 69611f9

Please sign in to comment.