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:
Roberto Tonino 2020-11-20 18:18:19 +01:00
parent d20540f46e
commit 88da837663
4 changed files with 11 additions and 6 deletions

View File

@ -1,6 +1,6 @@
{ {
"name": "deemix-webui", "name": "deemix-webui",
"version": "1.3.6", "version": "1.4.0",
"scripts": { "scripts": {
"clean": "rimraf public/js/bundle.js public/js/bundle.temp.js public/js/bundle.js.map", "clean": "rimraf public/js/bundle.js public/js/bundle.temp.js public/js/bundle.js.map",
"clean-temp": "rimraf public/js/bundle.temp.js", "clean-temp": "rimraf public/js/bundle.temp.js",

File diff suppressed because one or more lines are too long

View File

@ -29,7 +29,7 @@ export function formatSingleTrack(track) {
/* Track */ /* Track */
trackTitle: getPropertyWithFallback(track, 'title', 'SNG_TITLE'), trackTitle: getPropertyWithFallback(track, 'title', 'SNG_TITLE'),
trackTitleVersion: getPropertyWithFallback(track, 'title_version', 'VERSION'), trackTitleVersion: getPropertyWithFallback(track, 'title_version', 'VERSION'),
trackPreview: getPropertyWithFallback(track, 'preview'), trackPreview: getPropertyWithFallback(track, 'preview', 'MEDIA.0.HREF'),
trackDuration: getPropertyWithFallback(track, 'duration', 'DURATION'), trackDuration: getPropertyWithFallback(track, 'duration', 'DURATION'),
trackLink: getPropertyWithFallback(track, 'link') || `https://www.deezer.com/track/${track.SNG_ID}`, trackLink: getPropertyWithFallback(track, 'link') || `https://www.deezer.com/track/${track.SNG_ID}`,
isTrackExplicit, isTrackExplicit,
@ -43,7 +43,7 @@ export function formatSingleTrack(track) {
albumTitle: getPropertyWithFallback(track, 'album.title', 'ALB_TITLE'), albumTitle: getPropertyWithFallback(track, 'album.title', 'ALB_TITLE'),
albumPicture: albumPicture:
getPropertyWithFallback(track, 'album.cover_small') || 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`
} }
} }

View File

@ -96,6 +96,11 @@ export function copyToClipboard(text) {
ghostInput.remove() ghostInput.remove()
} }
/**
* @param {object|array} obj
* @param {...any} props
* @returns {any|null} property requested
*/
export function getPropertyWithFallback(obj, ...props) { export function getPropertyWithFallback(obj, ...props) {
for (const prop of props) { for (const prop of props) {
// Example: this.is.an.example // Example: this.is.an.example