diff --git a/index.js b/index.js index 58caa27..c7b2c14 100644 --- a/index.js +++ b/index.js @@ -34,7 +34,7 @@ async function getVideo() { const tags = { title: trackData.name, artist: trackData.artist.name, - album: trackData.album["#text"], + album: trackData.album["#text"] || trackData.name, APIC: "./cover.png", userDefinedUrl: [{ description: "Last.FM page", @@ -92,7 +92,7 @@ async function getVideo() { return { tags, ...selectedVideo, - albumCover: trackData.image.at(-1)["#text"] + albumCover: trackData.image?.at(-1)["#text"] }; } @@ -212,7 +212,7 @@ async function main() { }) let albumCover; - if (!(await checkNextcloudAlbum(video, nextcloudClient))) { + if (!(await checkNextcloudAlbum(video, nextcloudClient)) && video.albumCover != null) { albumCover = await downloadAlbumCover(video); }