Merge pull request #194 from semvis123/songprovider-update

Improved songinfo provider, by using the data from the '/player' request
This commit is contained in:
th-ch
2021-03-28 21:12:03 +02:00
committed by GitHub
4 changed files with 52 additions and 76 deletions

View File

@ -24,7 +24,10 @@ module.exports = (win, {activityTimoutEnabled, activityTimoutTime}) => {
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) {
@ -50,8 +53,7 @@ module.exports = (win, {activityTimoutEnabled, activityTimoutTime}) => {
});
// Startup the rpc client
rpc
.login({
rpc.login({
clientId,
})
.catch(console.error);