Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add album title to largeImage and change paused icon #587

Merged
merged 2 commits into from
Feb 13, 2022
Merged
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
17 changes: 7 additions & 10 deletions plugins/discord/back.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,8 @@ const { dialog, app } = require("electron");

const registerCallback = require("../../providers/song-info");

// Application ID registered by @semvis123
const clientId = "790655993809338398";
// Application ID registered by @xn-oah
const clientId = "937234785716285471";

/**
* @typedef {Object} Info
Expand Down Expand Up @@ -104,19 +104,16 @@ module.exports = (win, { activityTimoutEnabled, activityTimoutTime, listenAlong
details: songInfo.title,
state: songInfo.artist,
largeImageKey: songInfo.imageSrc,
largeImageText: [
songInfo.uploadDate,
songInfo.views.toString().replace(/\B(?=(\d{3})+(?!\d))/g, ",") + " views",
].join(' || '),
buttons: listenAlong ? [
largeImageText: songInfo.album,
buttons: listenAlong ? [
{ label: "Listen Along", url: songInfo.url },
] : undefined,
};

if (songInfo.isPaused) {
// Add an idle icon to show that the song is paused
activityInfo.smallImageKey = "idle";
activityInfo.smallImageText = "idle/paused";
// Add a paused icon to show that the song is paused
activityInfo.smallImageKey = "paused";
activityInfo.smallImageText = "Paused";
// Set start the timer so the activity gets cleared after a while if enabled
if (activityTimoutEnabled)
clearActivity = setTimeout(() => info.rpc.clearActivity().catch(console.error), activityTimoutTime ?? 10000);
Expand Down