fix(scrobbler): remove snake_case

This commit is contained in:
JellyBrick
2024-02-18 20:21:19 +09:00
parent 5edb2131d2
commit 00d0b31980
4 changed files with 53 additions and 35 deletions

View File

@ -16,24 +16,42 @@ const migrations = {
secret?: string;
};
if (lastfmConfig) {
const scrobblerConfig = store.get(
let scrobblerConfig = store.get(
'plugins.scrobbler',
) as {
enabled?: boolean;
scrobblers: {
lastfm: {
scrobblers?: {
lastfm?: {
enabled?: boolean;
token?: string;
session_key?: string;
api_root?: string;
api_key?: string;
sessionKey?: string;
apiRoot?: string;
apiKey?: string;
secret?: string;
};
};
};
} | undefined;
scrobblerConfig.enabled = lastfmConfig.enabled;
scrobblerConfig.scrobblers.lastfm = lastfmConfig;
if (!scrobblerConfig) {
scrobblerConfig = {
enabled: lastfmConfig.enabled,
};
}
if (!scrobblerConfig.scrobblers) {
scrobblerConfig.scrobblers = {
lastfm: {},
};
}
scrobblerConfig.scrobblers.lastfm = {
enabled: lastfmConfig.enabled,
token: lastfmConfig.token,
sessionKey: lastfmConfig.session_key,
apiRoot: lastfmConfig.api_root,
apiKey: lastfmConfig.api_key,
secret: lastfmConfig.secret,
};
store.set('plugins.scrobbler', scrobblerConfig);
}
},