diff --git a/src/rpc/client.js b/src/rpc/client.js index 2e6e2bd..000bffb 100755 --- a/src/rpc/client.js +++ b/src/rpc/client.js @@ -45,12 +45,12 @@ function update() { awake = false; client.clearActivity(); } else { - if (config.console.presencestate == true){ - console.log("Presence updated") - } - client.setActivity(await format(status)); - awake = false; - } + if (config.console.presencestate == true){ + console.log("Presence updated") + } + client.setActivity(await format(status)); + awake = false; + } } } }); diff --git a/src/rpc/format.js b/src/rpc/format.js index 989680c..8f87e4d 100755 --- a/src/rpc/format.js +++ b/src/rpc/format.js @@ -200,6 +200,7 @@ module.exports = async (status) => { ); let output = { + type: 0, // Shows file thats playing.. well most of the time details: meta.title || meta.filename || "Playing something..", // Sets album art depending on whats set in the file, or if album art cannot be found @@ -216,10 +217,9 @@ module.exports = async (status) => { : undefined) }; - if(status.stats.decodedvideo > 0) - { // if video - if (meta['YouTube Start Time'] !== undefined) - { // if youtube video + if(status.stats.decodedvideo > 0) { // if video + output.type = 3; + if (meta['YouTube Start Time'] !== undefined) { // if youtube video output.largeImageKey = 'youtube'; output.largeImageText = meta.url; } @@ -237,14 +237,11 @@ module.exports = async (status) => { } else { output.state = `${(status.date || '')} Video`; } - } - else if (meta.now_playing) - { // if a stream + } else if (meta.now_playing) { // if a stream + output.type = 1; output.state = meta.now_playing || "Stream"; - } - else if (display_artist) - { // if a song - + } else if (display_artist) { // if a song + output.type = 2; // Add artist to the state output.state = display_artist;