mirror of
https://github.com/th-ch/youtube-music.git
synced 2026-01-14 11:51:47 +00:00
feat(synced-lyrics): preferred provider (global/per-song) (#3741)
Co-authored-by: JellyBrick <shlee1503@naver.com>
This commit is contained in:
@ -1,5 +1,7 @@
|
||||
import { t } from '@/i18n';
|
||||
|
||||
import { providerNames } from './providers';
|
||||
|
||||
import type { MenuItemConstructorOptions } from 'electron';
|
||||
import type { MenuContext } from '@/types/contexts';
|
||||
import type { SyncedLyricsPluginConfig } from './types';
|
||||
@ -10,6 +12,35 @@ export const menu = async (
|
||||
const config = await ctx.getConfig();
|
||||
|
||||
return [
|
||||
{
|
||||
label: t('plugins.synced-lyrics.menu.preferred-provider.label'),
|
||||
toolTip: t('plugins.synced-lyrics.menu.preferred-provider.tooltip'),
|
||||
type: 'submenu',
|
||||
submenu: [
|
||||
{
|
||||
label: t('plugins.synced-lyrics.menu.preferred-provider.none.label'),
|
||||
toolTip: t(
|
||||
'plugins.synced-lyrics.menu.preferred-provider.none.tooltip',
|
||||
),
|
||||
type: 'radio',
|
||||
checked: config.preferredProvider === undefined,
|
||||
click() {
|
||||
ctx.setConfig({ preferredProvider: undefined });
|
||||
},
|
||||
},
|
||||
...providerNames.map(
|
||||
(provider) =>
|
||||
({
|
||||
label: provider,
|
||||
type: 'radio',
|
||||
checked: config.preferredProvider === provider,
|
||||
click() {
|
||||
ctx.setConfig({ preferredProvider: provider });
|
||||
},
|
||||
}) as const,
|
||||
),
|
||||
],
|
||||
},
|
||||
{
|
||||
label: t('plugins.synced-lyrics.menu.precise-timing.label'),
|
||||
toolTip: t('plugins.synced-lyrics.menu.precise-timing.tooltip'),
|
||||
|
||||
Reference in New Issue
Block a user