mirror of
https://github.com/abocn/TelegramBot.git
synced 2025-03-10 12:49:57 +00:00
Refactored variables from getFromMusicBrainz()
This commit is contained in:
parent
11ec1926cb
commit
a7577c7b2b
@ -37,8 +37,9 @@ function saveUsers() {
|
|||||||
async function getFromMusicBrainz(mbid) {
|
async function getFromMusicBrainz(mbid) {
|
||||||
try {
|
try {
|
||||||
const response = await axios.get(`https://coverartarchive.org/release/${mbid}`);
|
const response = await axios.get(`https://coverartarchive.org/release/${mbid}`);
|
||||||
const imageUrlLarge = response.data.images[0]?.thumbnails?.large;
|
const imgObjLarge = response.data.images[0]?.thumbnails?.['1200'];
|
||||||
const imageUrl = response.data.images[0]?.thumbnails?.['1200'] || imageUrlLarge || '';
|
const imgObjMid = response.data.images[0]?.thumbnails?.large;
|
||||||
|
const imageUrl = imgObjLarge || imgObjMid || '';
|
||||||
return imageUrl;
|
return imageUrl;
|
||||||
} catch (error) {
|
} catch (error) {
|
||||||
return undefined;
|
return undefined;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user