(song: MusicKit.MediaItem, container: any = null)
| 1 | import translate from './translations/Translations'; |
| 2 | |
| 3 | export function createMediaItem(song: MusicKit.MediaItem, container: any = null) { |
| 4 | if (container) { |
| 5 | const containerName = |
| 6 | container.type === 'albums' || container.type === 'library-albums' ? 'albums' : 'playlists'; |
| 7 | |
| 8 | return { |
| 9 | ...song, |
| 10 | container: { |
| 11 | id: container.id, |
| 12 | type: container.type, |
| 13 | name: containerName, |
| 14 | }, |
| 15 | }; |
| 16 | } |
| 17 | |
| 18 | return { |
| 19 | ...song, |
| 20 | container: { |
| 21 | id: song.id, |
| 22 | }, |
| 23 | }; |
| 24 | } |
| 25 | |
| 26 | export function artworkForMediaItem(item: MusicKit.MediaItem, size: number) { |
| 27 | if (!item.attributes || !item.attributes.artwork) { |
no outgoing calls
no test coverage detected