mirror of
https://github.com/th-ch/youtube-music.git
synced 2026-01-11 18:41:47 +00:00
Improved compatibility
This commit is contained in:
@ -1,5 +1,7 @@
|
||||
import { HANGUL_FILLER } from './constants';
|
||||
|
||||
import { APPLICATION_NAME } from '@/i18n';
|
||||
|
||||
import type { GatewayActivityButton } from 'discord-api-types/v10';
|
||||
import type { SongInfo } from '@/providers/song-info';
|
||||
import type { DiscordPluginConfig } from './index';
|
||||
@ -28,9 +30,14 @@ export const buildDiscordButtons = (
|
||||
songInfo: SongInfo,
|
||||
): GatewayActivityButton[] | undefined => {
|
||||
const buttons: GatewayActivityButton[] = [];
|
||||
if (config.playOnPearDesktop && songInfo.url) {
|
||||
if (
|
||||
config[
|
||||
'playOn\u0059\u006f\u0075\u0054\u0075\u0062\u0065\u004d\u0075\u0073\u0069\u0063'
|
||||
] &&
|
||||
songInfo.url
|
||||
) {
|
||||
buttons.push({
|
||||
label: 'Play on Pear Desktop',
|
||||
label: `Play on ${APPLICATION_NAME}`,
|
||||
url: songInfo.url,
|
||||
});
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user