Add Video support

This commit is contained in:
Marie 2021-04-21 03:31:44 +02:00 committed by GitHub
parent 7a30b125ec
commit 08ec7fadac
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -21,16 +21,28 @@ const observer = (event, arg) => {
const date = new Date(); const date = new Date();
let now = date.getTime() / 1000 | 0; let now = date.getTime() / 1000 | 0;
let remaining = date.setSeconds(date.getSeconds() + (dsec - csec)); let remaining = date.setSeconds(date.getSeconds() + (dsec - csec));
rpc.setActivity({ if (mediaInfoModule.mediaInfo.url) {
...idleStatus, rpc.setActivity({
...{ ...idleStatus,
details: `Listening to ${mediaInfoModule.mediaInfo.title}`, ...{
state: mediaInfoModule.mediaInfo.artist, details: `Listening to ${mediaInfoModule.mediaInfo.title}`,
startTimestamp: parseInt(now), state: mediaInfoModule.mediaInfo.artist,
endTimestamp: parseInt(remaining), startTimestamp: parseInt(now),
buttons: [{ label: "Play on Tidal", url: mediaInfoModule.mediaInfo.url }], endTimestamp: parseInt(remaining),
}, buttons: [{ label: "Play on Tidal", url: mediaInfoModule.mediaInfo.url }],
}); },
});
} else {
rpc.setActivity({
...idleStatus,
...{
details: `Listening to ${mediaInfoModule.mediaInfo.title}`,
state: mediaInfoModule.mediaInfo.artist,
startTimestamp: parseInt(now),
endTimestamp: parseInt(remaining),
},
});
}
} }
}; };