mirror of
https://github.com/th-ch/youtube-music.git
synced 2026-01-14 03:41:46 +00:00
@ -107,7 +107,7 @@ const defaultConfig = {
|
|||||||
autoReconnect: true, // If enabled, will try to reconnect to discord every 5 seconds after disconnecting or failing to connect
|
autoReconnect: true, // If enabled, will try to reconnect to discord every 5 seconds after disconnecting or failing to connect
|
||||||
activityTimoutEnabled: true, // If enabled, the discord rich presence gets cleared when music paused after the time specified below
|
activityTimoutEnabled: true, // If enabled, the discord rich presence gets cleared when music paused after the time specified below
|
||||||
activityTimoutTime: 10 * 60 * 1000, // 10 minutes
|
activityTimoutTime: 10 * 60 * 1000, // 10 minutes
|
||||||
listenAlong: true, // Add a "listen along" button to rich presence
|
playOnYouTubeMusic: true, // Add a "Play on YouTube Music" button to rich presence
|
||||||
hideGitHubButton: false, // Disable the "View App On GitHub" button
|
hideGitHubButton: false, // Disable the "View App On GitHub" button
|
||||||
hideDurationLeft: false, // Hides the start and end time of the song to rich presence
|
hideDurationLeft: false, // Hides the start and end time of the song to rich presence
|
||||||
},
|
},
|
||||||
|
|||||||
@ -20,6 +20,12 @@ const setDefaultPluginOptions = (store: Conf<Record<string, unknown>>, plugin: k
|
|||||||
};
|
};
|
||||||
|
|
||||||
const migrations = {
|
const migrations = {
|
||||||
|
'>=2.1.3'(store: Conf<Record<string, unknown>>) {
|
||||||
|
if (store.get('plugins.discord.listenAlong')) {
|
||||||
|
store.set('plugins.discord.playOnYouTubeMusic', true);
|
||||||
|
store.delete('plugins.discord.listenAlong');
|
||||||
|
}
|
||||||
|
},
|
||||||
'>=2.1.0'(store: Conf<Record<string, unknown>>) {
|
'>=2.1.0'(store: Conf<Record<string, unknown>>) {
|
||||||
const originalPreset = store.get('plugins.downloader.preset') as string | undefined;
|
const originalPreset = store.get('plugins.downloader.preset') as string | undefined;
|
||||||
if (originalPreset) {
|
if (originalPreset) {
|
||||||
|
|||||||
@ -170,7 +170,7 @@ export default (
|
|||||||
largeImageKey: songInfo.imageSrc ?? '',
|
largeImageKey: songInfo.imageSrc ?? '',
|
||||||
largeImageText: songInfo.album ?? '',
|
largeImageText: songInfo.album ?? '',
|
||||||
buttons: [
|
buttons: [
|
||||||
...(options.listenAlong ? [{ label: 'Listen Along', url: songInfo.url ?? '' }] : []),
|
...(options.playOnYouTubeMusic ? [{ label: 'Play on YouTube Music', url: songInfo.url ?? '' }] : []),
|
||||||
...(options.hideGitHubButton ? [] : [{ label: 'View App On GitHub', url: 'https://github.com/th-ch/youtube-music' }]),
|
...(options.hideGitHubButton ? [] : [{ label: 'View App On GitHub', url: 'https://github.com/th-ch/youtube-music' }]),
|
||||||
],
|
],
|
||||||
};
|
};
|
||||||
|
|||||||
@ -47,11 +47,11 @@ export default (win: Electron.BrowserWindow, options: DiscordOptions, refreshMen
|
|||||||
},
|
},
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
label: 'Listen Along',
|
label: 'Play on YouTube Music',
|
||||||
type: 'checkbox',
|
type: 'checkbox',
|
||||||
checked: options.listenAlong,
|
checked: options.playOnYouTubeMusic,
|
||||||
click(item: Electron.MenuItem) {
|
click(item: Electron.MenuItem) {
|
||||||
options.listenAlong = item.checked;
|
options.playOnYouTubeMusic = item.checked;
|
||||||
setMenuOptions('discord', options);
|
setMenuOptions('discord', options);
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
|
|||||||
Reference in New Issue
Block a user