feat: Better Scrobbler Plugin (#1640)

Co-authored-by: JellyBrick <shlee1503@naver.com>
This commit is contained in:
Alex
2024-01-16 02:36:27 -05:00
committed by GitHub
parent ea0f6c401d
commit f424ee5170
27 changed files with 671 additions and 357 deletions

View File

@ -6,6 +6,39 @@ import defaults from './defaults';
import { DefaultPresetList, type Preset } from '@/plugins/downloader/types';
const migrations = {
'>=3.3.0'(store: Conf<Record<string, unknown>>) {
const lastfmConfig = store.get('plugins.lastfm') as {
enabled?: boolean;
token?: string;
session_key?: string;
api_root?: string;
api_key?: string;
secret?: string;
};
if (lastfmConfig) {
const scrobblerConfig = store.get(
'plugins.scrobbler',
) as {
enabled?: boolean;
scrobblers: {
lastfm: {
enabled?: boolean;
token?: string;
session_key?: string;
api_root?: string;
api_key?: string;
secret?: string;
};
};
};
if (lastfmConfig) {
scrobblerConfig.enabled = lastfmConfig.enabled;
scrobblerConfig.scrobblers.lastfm = lastfmConfig;
store.set('plugins.scrobbler', scrobblerConfig);
}
}
},
'>=3.0.0'(store: Conf<Record<string, unknown>>) {
const discordConfig = store.get('plugins.discord') as Record<
string,