Add album image to media module and discord (#86)

Co-authored-by: Diogo Oliveira <diogoomarques98@gmail.com>
Co-authored-by: Marie <marie@kaifa.ch>
This commit is contained in:
Rick van Lieshout 2021-12-19 13:18:39 +01:00 committed by GitHub
parent c940d0991d
commit 0dec967e71
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 5 additions and 2 deletions

View File

@ -57,7 +57,7 @@ const elements = {
if (figure) {
const mediaElement = figure.querySelector(this["image"]);
if (mediaElement) {
return mediaElement.src;
return mediaElement.src.replace("80x80", "640x640");
}
}

View File

@ -31,6 +31,7 @@ const observer = (event, arg) => {
: "unknown artist(s)",
startTimestamp: parseInt(now),
endTimestamp: parseInt(remaining),
largeImageKey: mediaInfoModule.mediaInfo.image,
buttons: [{ label: "Play on Tidal", url: mediaInfoModule.mediaInfo.url }],
},
});

View File

@ -7,7 +7,8 @@ const mediaInfo = {
status: statuses.paused,
url: "",
current: "",
duration: ""
duration: "",
image: "tidal-hifi-icon"
};
const mediaInfoModule = {
mediaInfo,
@ -24,6 +25,7 @@ mediaInfoModule.update = function (arg) {
mediaInfo.status = propOrDefault(arg.status);
mediaInfo.current = propOrDefault(arg.current);
mediaInfo.duration = propOrDefault(arg.duration);
mediaInfo.image = propOrDefault(arg.image);
};
/**