feat: added tracks preview to all tab in Search page; style: track covers are now as abig as tracks tab ones in Search page; build: v1.4.0
This commit is contained in:
@@ -29,7 +29,7 @@ export function formatSingleTrack(track) {
|
||||
/* Track */
|
||||
trackTitle: getPropertyWithFallback(track, 'title', 'SNG_TITLE'),
|
||||
trackTitleVersion: getPropertyWithFallback(track, 'title_version', 'VERSION'),
|
||||
trackPreview: getPropertyWithFallback(track, 'preview'),
|
||||
trackPreview: getPropertyWithFallback(track, 'preview', 'MEDIA.0.HREF'),
|
||||
trackDuration: getPropertyWithFallback(track, 'duration', 'DURATION'),
|
||||
trackLink: getPropertyWithFallback(track, 'link') || `https://www.deezer.com/track/${track.SNG_ID}`,
|
||||
isTrackExplicit,
|
||||
@@ -43,7 +43,7 @@ export function formatSingleTrack(track) {
|
||||
albumTitle: getPropertyWithFallback(track, 'album.title', 'ALB_TITLE'),
|
||||
albumPicture:
|
||||
getPropertyWithFallback(track, 'album.cover_small') ||
|
||||
`https://e-cdns-images.dzcdn.net/images/cover/${track.ALB_PICTURE}/32x32-000000-80-0-0.jpg`
|
||||
`https://e-cdns-images.dzcdn.net/images/cover/${track.ALB_PICTURE}/56x56-000000-80-0-0.jpg`
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -96,6 +96,11 @@ export function copyToClipboard(text) {
|
||||
ghostInput.remove()
|
||||
}
|
||||
|
||||
/**
|
||||
* @param {object|array} obj
|
||||
* @param {...any} props
|
||||
* @returns {any|null} property requested
|
||||
*/
|
||||
export function getPropertyWithFallback(obj, ...props) {
|
||||
for (const prop of props) {
|
||||
// Example: this.is.an.example
|
||||
|
||||
Reference in New Issue
Block a user