Skip to content

Commit

Permalink
Loads providers before plugins
Browse files Browse the repository at this point in the history
  • Loading branch information
semvis123 committed Jan 10, 2021
1 parent 69f486d commit 3a5d9bd
Showing 1 changed file with 11 additions and 0 deletions.
11 changes: 11 additions & 0 deletions index.js
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,8 @@ if (config.get("options.disableHardwareAcceleration")) {
// Adds debug features like hotkeys for triggering dev tools and reload
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
let mainWindow;
autoUpdater.autoDownload = false;
Expand All @@ -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]) => {
console.log("Loaded plugin - " + plugin);
const pluginPath = path.join(__dirname, "plugins", plugin, "back.js");
Expand Down

0 comments on commit 3a5d9bd

Please sign in to comment.