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) { if (figure) {
const mediaElement = figure.querySelector(this["image"]); const mediaElement = figure.querySelector(this["image"]);
if (mediaElement) { if (mediaElement) {
return mediaElement.src; return mediaElement.src.replace("80x80", "640x640");
} }
} }

View File

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

View File

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