mirror of
https://github.com/Mastermindzh/tidal-hifi.git
synced 2024-11-22 13:32:42 +01:00
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:
parent
c940d0991d
commit
0dec967e71
@ -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");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -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 }],
|
||||||
},
|
},
|
||||||
});
|
});
|
||||||
|
@ -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);
|
||||||
};
|
};
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
Loading…
Reference in New Issue
Block a user