mirror of
https://github.com/th-ch/youtube-music.git
synced 2026-01-14 20:01:47 +00:00
convert plugins
This commit is contained in:
@ -3,8 +3,8 @@ import { DefaultPresetList, Preset } from './types';
|
||||
import style from './style.css?inline';
|
||||
|
||||
import { createPlugin } from '@/utils';
|
||||
import { onConfigChange, onMainLoad } from '@/plugins/downloader/main';
|
||||
import { onPlayerApiReady, onRendererLoad } from '@/plugins/downloader/renderer';
|
||||
import { onConfigChange, onMainLoad } from './main';
|
||||
import { onPlayerApiReady, onRendererLoad } from './renderer';
|
||||
|
||||
export type DownloaderPluginConfig = {
|
||||
enabled: boolean;
|
||||
@ -15,17 +15,19 @@ export type DownloaderPluginConfig = {
|
||||
playlistMaxItems?: number;
|
||||
}
|
||||
|
||||
export const defaultConfig: DownloaderPluginConfig = {
|
||||
enabled: false,
|
||||
downloadFolder: undefined,
|
||||
selectedPreset: 'mp3 (256kbps)', // Selected preset
|
||||
customPresetSetting: DefaultPresetList['mp3 (256kbps)'], // Presets
|
||||
skipExisting: false,
|
||||
playlistMaxItems: undefined,
|
||||
};
|
||||
|
||||
export default createPlugin({
|
||||
name: 'Downloader',
|
||||
restartNeeded: true,
|
||||
config: {
|
||||
enabled: false,
|
||||
downloadFolder: undefined,
|
||||
selectedPreset: 'mp3 (256kbps)', // Selected preset
|
||||
customPresetSetting: DefaultPresetList['mp3 (256kbps)'], // Presets
|
||||
skipExisting: false,
|
||||
playlistMaxItems: undefined,
|
||||
} as DownloaderPluginConfig,
|
||||
config: defaultConfig,
|
||||
stylesheets: [style],
|
||||
backend: {
|
||||
start: onMainLoad,
|
||||
|
||||
Reference in New Issue
Block a user