Skip to content

Commit

Permalink
Include an Artist - Song line in the Dock context menu
Browse files Browse the repository at this point in the history
To see if the lyrics are sync/unsync.
  • Loading branch information
TomasHubelbauer committed Jun 11, 2024
1 parent aaf1f81 commit 662a1f6
Showing 1 changed file with 12 additions and 0 deletions.
12 changes: 12 additions & 0 deletions index.js
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,15 @@ electron.app.on('ready', async () => {
function refreshDockMenu() {
const menu = new electron.Menu();

if (lyrics) {
const artistSongMenuItem = new electron.MenuItem({
label: `${lyrics.artist} - ${lyrics.song} (${lyrics.syncType === 'LINE_SYNCED' ? 'synchronized' : 'unsynchronized'})`,
enabled: false
});

menu.append(artistSongMenuItem);
}

const refreshTokenMenuItem = new electron.MenuItem({
label: `Refresh token (${authorizationStamp.toLocaleTimeString()})`,
click: async () => {
Expand Down Expand Up @@ -241,6 +250,9 @@ electron.app.on('ready', async () => {
}
}
}

// Refresh the `Artist - Song` menu item in the Dock context menu
refreshDockMenu();
}

try {
Expand Down

0 comments on commit 662a1f6

Please sign in to comment.