From fba98d44a153a0f4b26a2047bb792091c230c5ef Mon Sep 17 00:00:00 2001 From: RemixDev Date: Sat, 29 May 2021 17:41:44 +0200 Subject: [PATCH] Fixed top result download button not working --- server/dist/routes/api/get/mainSearch.js | 10 ++++++---- server/src/routes/api/get/mainSearch.ts | 10 ++++++---- webui | 2 +- 3 files changed, 13 insertions(+), 9 deletions(-) diff --git a/server/dist/routes/api/get/mainSearch.js b/server/dist/routes/api/get/mainSearch.js index 1a12e62..7bf7296 100644 --- a/server/dist/routes/api/get/mainSearch.js +++ b/server/dist/routes/api/get/mainSearch.js @@ -32,29 +32,31 @@ const handler = (req, res) => __awaiter(void 0, void 0, void 0, function* () { switch (topResult.type) { case 'artist': topResult.id = originalTopResult.ART_ID; - topResult.picture = `https://e-cdns-images.dzcdn.net/images/artist/${originalTopResult.ART_PICTURE}/156x156-000000-80-0-0.jpg`; + topResult.picture = `https://e-cdns-images.dzcdn.net/images/artist/${originalTopResult.ART_PICTURE}`; topResult.title = originalTopResult.ART_NAME; topResult.nb_fan = originalTopResult.NB_FAN; break; case 'album': topResult.id = originalTopResult.ALB_ID; - topResult.picture = `https://e-cdns-images.dzcdn.net/images/cover/${originalTopResult.ALB_PICTURE}/156x156-000000-80-0-0.jpg`; + topResult.picture = `https://e-cdns-images.dzcdn.net/images/cover/${originalTopResult.ALB_PICTURE}`; topResult.title = originalTopResult.ALB_TITLE; topResult.artist = originalTopResult.ART_NAME; topResult.nb_song = originalTopResult.NUMBER_TRACK; break; case 'playlist': topResult.id = originalTopResult.PLAYLIST_ID; - topResult.picture = `https://e-cdns-images.dzcdn.net/images/${originalTopResult.PICTURE_TYPE}/${originalTopResult.PLAYLIST_PICTURE}/156x156-000000-80-0-0.jpg`; + topResult.picture = `https://e-cdns-images.dzcdn.net/images/${originalTopResult.PICTURE_TYPE}/${originalTopResult.PLAYLIST_PICTURE}`; topResult.title = originalTopResult.TITLE; topResult.artist = originalTopResult.PARENT_USERNAME; topResult.nb_song = originalTopResult.NB_SONG; break; default: topResult.id = '0'; - topResult.picture = 'https://e-cdns-images.dzcdn.net/images/cover/156x156-000000-80-0-0.jpg'; + topResult.picture = 'https://e-cdns-images.dzcdn.net/images/cover'; break; } + topResult.picture += '/156x156-000000-80-0-0.jpg'; + topResult.link = `https://deezer.com/${topResult.type}/${topResult.id}`; results.TOP_RESULT = [topResult]; } results.ORDER = order; diff --git a/server/src/routes/api/get/mainSearch.ts b/server/src/routes/api/get/mainSearch.ts index e7c6ed6..c92bc9c 100644 --- a/server/src/routes/api/get/mainSearch.ts +++ b/server/src/routes/api/get/mainSearch.ts @@ -23,29 +23,31 @@ const handler: ApiHandler['handler'] = async (req, res) => { switch (topResult.type) { case 'artist': topResult.id = originalTopResult.ART_ID - topResult.picture = `https://e-cdns-images.dzcdn.net/images/artist/${originalTopResult.ART_PICTURE}/156x156-000000-80-0-0.jpg` + topResult.picture = `https://e-cdns-images.dzcdn.net/images/artist/${originalTopResult.ART_PICTURE}` topResult.title = originalTopResult.ART_NAME topResult.nb_fan = originalTopResult.NB_FAN break case 'album': topResult.id = originalTopResult.ALB_ID - topResult.picture = `https://e-cdns-images.dzcdn.net/images/cover/${originalTopResult.ALB_PICTURE}/156x156-000000-80-0-0.jpg` + topResult.picture = `https://e-cdns-images.dzcdn.net/images/cover/${originalTopResult.ALB_PICTURE}` topResult.title = originalTopResult.ALB_TITLE topResult.artist = originalTopResult.ART_NAME topResult.nb_song = originalTopResult.NUMBER_TRACK break case 'playlist': topResult.id = originalTopResult.PLAYLIST_ID - topResult.picture = `https://e-cdns-images.dzcdn.net/images/${originalTopResult.PICTURE_TYPE}/${originalTopResult.PLAYLIST_PICTURE}/156x156-000000-80-0-0.jpg` + topResult.picture = `https://e-cdns-images.dzcdn.net/images/${originalTopResult.PICTURE_TYPE}/${originalTopResult.PLAYLIST_PICTURE}` topResult.title = originalTopResult.TITLE topResult.artist = originalTopResult.PARENT_USERNAME topResult.nb_song = originalTopResult.NB_SONG break default: topResult.id = '0' - topResult.picture = 'https://e-cdns-images.dzcdn.net/images/cover/156x156-000000-80-0-0.jpg' + topResult.picture = 'https://e-cdns-images.dzcdn.net/images/cover' break } + topResult.picture += '/156x156-000000-80-0-0.jpg' + topResult.link = `https://deezer.com/${topResult.type}/${topResult.id}` results.TOP_RESULT = [topResult] } results.ORDER = order diff --git a/webui b/webui index bd22aef..1b369da 160000 --- a/webui +++ b/webui @@ -1 +1 @@ -Subproject commit bd22aef8cc1c00d8446f5d3a518e5552acba133d +Subproject commit 1b369da0b9f3e046313e6c09ec577e723ebfe92d