mirror of
https://github.com/antebudimir/feishin.git
synced 2026-01-01 18:33:33 +00:00
* feat: Discord Rich Presence album art via Last.fm * fix: securely fetch album art
This commit is contained in:
parent
61d7e7c390
commit
21f4a78dd7
4 changed files with 51 additions and 1 deletions
|
|
@ -4,12 +4,17 @@ import {
|
|||
SettingOption,
|
||||
SettingsSection,
|
||||
} from '/@/renderer/features/settings/components/settings-section';
|
||||
import { useDiscordSetttings, useSettingsStoreActions } from '/@/renderer/store';
|
||||
import {
|
||||
useDiscordSetttings,
|
||||
useSettingsStoreActions,
|
||||
useGeneralSettings,
|
||||
} from '/@/renderer/store';
|
||||
import { useTranslation } from 'react-i18next';
|
||||
|
||||
export const DiscordSettings = () => {
|
||||
const { t } = useTranslation();
|
||||
const settings = useDiscordSetttings();
|
||||
const generalSettings = useGeneralSettings();
|
||||
const { setSettings } = useSettingsStoreActions();
|
||||
|
||||
const discordOptions: SettingOption[] = [
|
||||
|
|
@ -142,6 +147,31 @@ export const DiscordSettings = () => {
|
|||
postProcess: 'sentenceCase',
|
||||
}),
|
||||
},
|
||||
{
|
||||
control: (
|
||||
<TextInput
|
||||
defaultValue={generalSettings.lastfmApiKey}
|
||||
onBlur={(e) => {
|
||||
setSettings({
|
||||
general: {
|
||||
...generalSettings,
|
||||
lastfmApiKey: e.currentTarget.value,
|
||||
},
|
||||
});
|
||||
}}
|
||||
/>
|
||||
),
|
||||
description: t('setting.lastfmApiKey', {
|
||||
context: 'description',
|
||||
lastfm: 'Last.fm',
|
||||
postProcess: 'sentenceCase',
|
||||
}),
|
||||
isHidden: !isElectron(),
|
||||
title: t('setting.lastfmApiKey', {
|
||||
lastfm: 'Last.fm',
|
||||
postProcess: 'sentenceCase',
|
||||
}),
|
||||
},
|
||||
];
|
||||
|
||||
return <SettingsSection options={discordOptions} />;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue