Improved compatibility

This commit is contained in:
JellyBrick
2025-12-20 21:57:47 +09:00
parent 29736f480d
commit 696ff0fc7a
75 changed files with 415 additions and 375 deletions

View File

@ -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,
});
}