use iitunes api to stop depending on links
This commit is contained in:
parent
27b7f9b5f8
commit
da13cdf3e9
2 changed files with 44 additions and 46 deletions
|
|
@ -32,7 +32,9 @@ const songLinkShape = z.object({
|
|||
export const preferredProviders = [
|
||||
"spotify",
|
||||
"deezer",
|
||||
"youtubeMusic"
|
||||
"youtubeMusic",
|
||||
"tidal",
|
||||
"itunes"
|
||||
];
|
||||
|
||||
export function getSongOnPreferredProvider(json: any, link: string): Song | null {
|
||||
|
|
@ -44,13 +46,12 @@ export function getSongOnPreferredProvider(json: any, link: string): Song | null
|
|||
}
|
||||
const entityId = song.linksByPlatform[platform].entityUniqueId;
|
||||
const songInfo = song.entitiesByUniqueId[entityId]
|
||||
|
||||
return {
|
||||
title: songInfo.title,
|
||||
artist: songInfo.artistName,
|
||||
apiProvider: songInfo.apiProvider,
|
||||
thumbnailUrl: songInfo.thumbnailUrl,
|
||||
link
|
||||
link: song.linksByPlatform[platform].url,
|
||||
}
|
||||
}
|
||||
return null
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue