Fixed top result download button not working

This commit is contained in:
RemixDev 2021-05-29 17:41:44 +02:00
parent 972fc007dc
commit fba98d44a1
3 changed files with 13 additions and 9 deletions

View File

@ -32,29 +32,31 @@ const handler = (req, res) => __awaiter(void 0, void 0, void 0, function* () {
switch (topResult.type) { switch (topResult.type) {
case 'artist': case 'artist':
topResult.id = originalTopResult.ART_ID; 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.title = originalTopResult.ART_NAME;
topResult.nb_fan = originalTopResult.NB_FAN; topResult.nb_fan = originalTopResult.NB_FAN;
break; break;
case 'album': case 'album':
topResult.id = originalTopResult.ALB_ID; 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.title = originalTopResult.ALB_TITLE;
topResult.artist = originalTopResult.ART_NAME; topResult.artist = originalTopResult.ART_NAME;
topResult.nb_song = originalTopResult.NUMBER_TRACK; topResult.nb_song = originalTopResult.NUMBER_TRACK;
break; break;
case 'playlist': case 'playlist':
topResult.id = originalTopResult.PLAYLIST_ID; 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.title = originalTopResult.TITLE;
topResult.artist = originalTopResult.PARENT_USERNAME; topResult.artist = originalTopResult.PARENT_USERNAME;
topResult.nb_song = originalTopResult.NB_SONG; topResult.nb_song = originalTopResult.NB_SONG;
break; break;
default: default:
topResult.id = '0'; 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; break;
} }
topResult.picture += '/156x156-000000-80-0-0.jpg';
topResult.link = `https://deezer.com/${topResult.type}/${topResult.id}`;
results.TOP_RESULT = [topResult]; results.TOP_RESULT = [topResult];
} }
results.ORDER = order; results.ORDER = order;

View File

@ -23,29 +23,31 @@ const handler: ApiHandler['handler'] = async (req, res) => {
switch (topResult.type) { switch (topResult.type) {
case 'artist': case 'artist':
topResult.id = originalTopResult.ART_ID 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.title = originalTopResult.ART_NAME
topResult.nb_fan = originalTopResult.NB_FAN topResult.nb_fan = originalTopResult.NB_FAN
break break
case 'album': case 'album':
topResult.id = originalTopResult.ALB_ID 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.title = originalTopResult.ALB_TITLE
topResult.artist = originalTopResult.ART_NAME topResult.artist = originalTopResult.ART_NAME
topResult.nb_song = originalTopResult.NUMBER_TRACK topResult.nb_song = originalTopResult.NUMBER_TRACK
break break
case 'playlist': case 'playlist':
topResult.id = originalTopResult.PLAYLIST_ID 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.title = originalTopResult.TITLE
topResult.artist = originalTopResult.PARENT_USERNAME topResult.artist = originalTopResult.PARENT_USERNAME
topResult.nb_song = originalTopResult.NB_SONG topResult.nb_song = originalTopResult.NB_SONG
break break
default: default:
topResult.id = '0' 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 break
} }
topResult.picture += '/156x156-000000-80-0-0.jpg'
topResult.link = `https://deezer.com/${topResult.type}/${topResult.id}`
results.TOP_RESULT = [topResult] results.TOP_RESULT = [topResult]
} }
results.ORDER = order results.ORDER = order

2
webui

@ -1 +1 @@
Subproject commit bd22aef8cc1c00d8446f5d3a518e5552acba133d Subproject commit 1b369da0b9f3e046313e6c09ec577e723ebfe92d