mirror of
https://github.com/abocn/TelegramBot.git
synced 2025-03-10 04:39: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) {
|
||||
try {
|
||||
const response = await axios.get(`https://coverartarchive.org/release/${mbid}`);
|
||||
const imageUrlLarge = response.data.images[0]?.thumbnails?.large;
|
||||
const imageUrl = response.data.images[0]?.thumbnails?.['1200'] || imageUrlLarge || '';
|
||||
const imgObjLarge = response.data.images[0]?.thumbnails?.['1200'];
|
||||
const imgObjMid = response.data.images[0]?.thumbnails?.large;
|
||||
const imageUrl = imgObjLarge || imgObjMid || '';
|
||||
return imageUrl;
|
||||
} catch (error) {
|
||||
return undefined;
|
||||
|
Loading…
x
Reference in New Issue
Block a user