Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 6 additions & 6 deletions src/rpc/client.js
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}
}
}
});
Expand Down
19 changes: 8 additions & 11 deletions src/rpc/format.js
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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;
}
Expand All @@ -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;

Expand Down
Loading