Various updates to backend.

Implementation of MPRIS in TS.
LastFM now interacts with store object passed directly into class.
Experimental decorators enabled and utilised in MPRIS.
This commit is contained in:
Core 2022-01-26 05:13:46 +00:00
parent b4293cf065
commit 27becacbb7
No known key found for this signature in database
GPG key ID: FE9BF1B547F8F3C6
10 changed files with 305 additions and 84 deletions

View file

@ -5,10 +5,11 @@ import * as electron from 'electron'
export default class PluginHandler {
private basePluginsPath = path.join(__dirname, '../plugins');
private userPluginsPath = path.join(electron.app.getPath('userData'), 'plugins');
private pluginsList: any = {};
constructor() {
private readonly pluginsList: any = {};
private readonly _store: any;
constructor(config: any) {
this._store = config;
this.pluginsList = this.getPlugins();
}
@ -23,7 +24,7 @@ export default class PluginHandler {
if (plugins[file] || plugin.name in plugins) {
console.log(`[${plugin.name}] Plugin already loaded / Duplicate Class Name`);
} else {
plugins[file] = new plugin(electron.app);
plugins[file] = new plugin(electron.app, this._store);
}
}
});
@ -38,7 +39,7 @@ export default class PluginHandler {
if (plugins[file] || plugin in plugins) {
console.log(`[${plugin.name}] Plugin already loaded / Duplicate Class Name`);
} else {
plugins[file] = new plugin(electron.app);
plugins[file] = new plugin(electron.app, this._store);
}
}
});