Merge pull request #3531 from thornbill/remove-plugin-get-routes
Remove broken method of registering routes for plugins
This commit is contained in:
commit
3a14418e47
1 changed files with 136 additions and 153 deletions
|
@ -9,12 +9,10 @@ import * as inputManager from '../scripts/inputManager';
|
||||||
import toast from '../components/toast/toast';
|
import toast from '../components/toast/toast';
|
||||||
import confirm from '../components/confirm/confirm';
|
import confirm from '../components/confirm/confirm';
|
||||||
|
|
||||||
/* eslint-disable indent */
|
// TODO: replace with each plugin version
|
||||||
|
const cacheParam = new Date().getTime();
|
||||||
|
|
||||||
// TODO: replace with each plugin version
|
class PluginManager {
|
||||||
const cacheParam = new Date().getTime();
|
|
||||||
|
|
||||||
class PluginManager {
|
|
||||||
pluginsList = [];
|
pluginsList = [];
|
||||||
|
|
||||||
get plugins() {
|
get plugins() {
|
||||||
|
@ -29,22 +27,9 @@ import confirm from '../components/confirm/confirm';
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
#definePluginRoute(route, plugin) {
|
|
||||||
route.contentPath = this.mapPath(plugin, route.path);
|
|
||||||
route.path = this.#mapRoute(plugin, route);
|
|
||||||
|
|
||||||
Emby.App.defineRoute(route, plugin.id);
|
|
||||||
}
|
|
||||||
|
|
||||||
async #registerPlugin(plugin) {
|
async #registerPlugin(plugin) {
|
||||||
this.#register(plugin);
|
this.#register(plugin);
|
||||||
|
|
||||||
if (plugin.getRoutes) {
|
|
||||||
plugin.getRoutes().forEach((route) => {
|
|
||||||
this.#definePluginRoute(route, plugin);
|
|
||||||
});
|
|
||||||
}
|
|
||||||
|
|
||||||
if (plugin.type === 'skin') {
|
if (plugin.type === 'skin') {
|
||||||
// translations won't be loaded for skins until needed
|
// translations won't be loaded for skins until needed
|
||||||
return plugin;
|
return plugin;
|
||||||
|
@ -167,8 +152,6 @@ import confirm from '../components/confirm/confirm';
|
||||||
|
|
||||||
return url;
|
return url;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/* eslint-enable indent */
|
|
||||||
|
|
||||||
export const pluginManager = new PluginManager();
|
export const pluginManager = new PluginManager();
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue