Skip to content

Commit 776cdac

Browse files
committed
feat(discord): rename Listen Along to Play on YTM
resolve #1341
1 parent 4333891 commit 776cdac

File tree

4 files changed

+11
-5
lines changed

4 files changed

+11
-5
lines changed

src/config/defaults.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -107,7 +107,7 @@ const defaultConfig = {
107107
autoReconnect: true, // If enabled, will try to reconnect to discord every 5 seconds after disconnecting or failing to connect
108108
activityTimoutEnabled: true, // If enabled, the discord rich presence gets cleared when music paused after the time specified below
109109
activityTimoutTime: 10 * 60 * 1000, // 10 minutes
110-
listenAlong: true, // Add a "listen along" button to rich presence
110+
playOnYouTubeMusic: true, // Add a "Play on YouTube Music" button to rich presence
111111
hideGitHubButton: false, // Disable the "View App On GitHub" button
112112
hideDurationLeft: false, // Hides the start and end time of the song to rich presence
113113
},

src/config/store.ts

+6
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,12 @@ const setDefaultPluginOptions = (store: Conf<Record<string, unknown>>, plugin: k
2020
};
2121

2222
const migrations = {
23+
'>=2.1.3'(store: Conf<Record<string, unknown>>) {
24+
if (store.get('plugins.discord.listenAlong')) {
25+
store.set('plugins.discord.playOnYouTubeMusic', true);
26+
store.delete('plugins.discord.listenAlong');
27+
}
28+
},
2329
'>=2.1.0'(store: Conf<Record<string, unknown>>) {
2430
const originalPreset = store.get('plugins.downloader.preset') as string | undefined;
2531
if (originalPreset) {

src/plugins/discord/back.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -170,7 +170,7 @@ export default (
170170
largeImageKey: songInfo.imageSrc ?? '',
171171
largeImageText: songInfo.album ?? '',
172172
buttons: [
173-
...(options.listenAlong ? [{ label: 'Listen Along', url: songInfo.url ?? '' }] : []),
173+
...(options.playOnYouTubeMusic ? [{ label: 'Play on YouTube Music', url: songInfo.url ?? '' }] : []),
174174
...(options.hideGitHubButton ? [] : [{ label: 'View App On GitHub', url: 'https://github.com/th-ch/youtube-music' }]),
175175
],
176176
};

src/plugins/discord/menu.ts

+3-3
Original file line numberDiff line numberDiff line change
@@ -47,11 +47,11 @@ export default (win: Electron.BrowserWindow, options: DiscordOptions, refreshMen
4747
},
4848
},
4949
{
50-
label: 'Listen Along',
50+
label: 'Play on YouTube Music',
5151
type: 'checkbox',
52-
checked: options.listenAlong,
52+
checked: options.playOnYouTubeMusic,
5353
click(item: Electron.MenuItem) {
54-
options.listenAlong = item.checked;
54+
options.playOnYouTubeMusic = item.checked;
5555
setMenuOptions('discord', options);
5656
},
5757
},

0 commit comments

Comments
 (0)