mirror of
https://github.com/advplyr/audiobookshelf.git
synced 2026-02-11 04:39:40 +00:00
Update plugins to only be enabled when ALLOW_PLUGINS=1 env variable is set or AllowPlugins: true in dev.js
This commit is contained in:
parent
50e84fc2d5
commit
e7e0056288
6 changed files with 37 additions and 17 deletions
|
|
@ -29,7 +29,8 @@ export const state = () => ({
|
|||
innerModalOpen: false,
|
||||
lastBookshelfScrollData: {},
|
||||
routerBasePath: '/',
|
||||
plugins: []
|
||||
plugins: [],
|
||||
pluginsEnabled: false
|
||||
})
|
||||
|
||||
export const getters = {
|
||||
|
|
@ -64,6 +65,7 @@ export const getters = {
|
|||
return state.serverSettings.homeBookshelfView
|
||||
},
|
||||
getPluginExtensions: (state) => (target) => {
|
||||
if (!state.pluginsEnabled) return []
|
||||
return state.plugins
|
||||
.map((pext) => {
|
||||
const extensionsMatchingTarget = pext.extensions?.filter((ext) => ext.target === target) || []
|
||||
|
|
@ -256,5 +258,6 @@ export const mutations = {
|
|||
},
|
||||
setPlugins(state, val) {
|
||||
state.plugins = val
|
||||
state.pluginsEnabled = true
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue