Improved songinfo provider, by using the data from the '/player' request

This commit is contained in:
Sem Visscher
2021-03-18 17:48:56 +01:00
parent c5bda4f3be
commit d852029d25
4 changed files with 52 additions and 77 deletions

View File

@ -22,7 +22,10 @@ module.exports = (win) => {
details: songInfo.title,
state: songInfo.artist,
largeImageKey: "logo",
largeImageText: songInfo.views + " - " + songInfo.likes,
largeImageText: [
songInfo.uploadDate,
songInfo.views.toString().replace(/\B(?=(\d{3})+(?!\d))/g, ",") + " views"
].join(' || '),
};
if (songInfo.isPaused) {
@ -42,8 +45,7 @@ module.exports = (win) => {
});
// Startup the rpc client
rpc
.login({
rpc.login({
clientId,
})
.catch(console.error);