Skip to content

Commit

Permalink
Merge pull request #15 from songish/master
Browse files Browse the repository at this point in the history
feat: add MusicBrainz IDs to song response
  • Loading branch information
alii authored Apr 20, 2024
2 parents 4e1e54b + 8c60f4a commit 5136426
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 0 deletions.
2 changes: 2 additions & 0 deletions src/lib.ts
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,8 @@ export function parseSong(
art: image?.['#text'] ?? lastSong.image[0]['#text'],
url: lastSong.url,
album: lastSong.album['#text'],
albumMbid: lastSong.album.mbid === '' ? null : lastSong.album.mbid,
trackMbid: lastSong.mbid === '' ? null : lastSong.mbid,
},
};
}
8 changes: 8 additions & 0 deletions src/types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -146,6 +146,14 @@ export type Song = {
* The URL of the track
*/
url: Track['url'];
/**
* MusicBrainz Identifier for the given track
*/
trackMbid: Track['mbid'] | null;
/**
* MusicBrainz Identifier for the given album
*/
albumMbid: TrackAlbum['mbid'] | null;
};

export interface LastFMResponseBody {
Expand Down

0 comments on commit 5136426

Please sign in to comment.