mirror of
https://github.com/th-ch/youtube-music.git
synced 2026-01-13 11:21:46 +00:00
Loads providers before plugins
This commit is contained in:
11
index.js
11
index.js
@ -28,6 +28,8 @@ if (config.get("options.disableHardwareAcceleration")) {
|
|||||||
// Adds debug features like hotkeys for triggering dev tools and reload
|
// Adds debug features like hotkeys for triggering dev tools and reload
|
||||||
require("electron-debug")();
|
require("electron-debug")();
|
||||||
|
|
||||||
|
// these are the providers for the plugins, this shouldn't be hardcoded but it's temporarily
|
||||||
|
const providers = ["song-info"];
|
||||||
// Prevent window being garbage collected
|
// Prevent window being garbage collected
|
||||||
let mainWindow;
|
let mainWindow;
|
||||||
autoUpdater.autoDownload = false;
|
autoUpdater.autoDownload = false;
|
||||||
@ -54,6 +56,15 @@ function loadPlugins(win) {
|
|||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
|
providers.forEach(provider => {
|
||||||
|
console.log("Loaded provider - " + provider);
|
||||||
|
const providerPath = path.join(__dirname, "providers", provider, "back.js");
|
||||||
|
fileExists(providerPath, () => {
|
||||||
|
const handle = require(providerPath);
|
||||||
|
handle(win);
|
||||||
|
});
|
||||||
|
});
|
||||||
|
|
||||||
config.plugins.getEnabled().forEach(([plugin, options]) => {
|
config.plugins.getEnabled().forEach(([plugin, options]) => {
|
||||||
console.log("Loaded plugin - " + plugin);
|
console.log("Loaded plugin - " + plugin);
|
||||||
const pluginPath = path.join(__dirname, "plugins", plugin, "back.js");
|
const pluginPath = path.join(__dirname, "plugins", plugin, "back.js");
|
||||||
|
|||||||
Reference in New Issue
Block a user