mirror of
https://github.com/advplyr/audiobookshelf.git
synced 2026-07-05 20:41:57 +02: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:
@@ -109,13 +109,16 @@ export default {
|
||||
id: 'config-authentication',
|
||||
title: this.$strings.HeaderAuthentication,
|
||||
path: '/config/authentication'
|
||||
},
|
||||
{
|
||||
}
|
||||
]
|
||||
|
||||
if (this.$store.state.pluginsEnabled) {
|
||||
configRoutes.push({
|
||||
id: 'config-plugins',
|
||||
title: 'Plugins',
|
||||
path: '/config/plugins'
|
||||
}
|
||||
]
|
||||
})
|
||||
}
|
||||
|
||||
if (this.currentLibraryId) {
|
||||
configRoutes.push({
|
||||
|
||||
@@ -170,7 +170,10 @@ export default {
|
||||
this.$store.commit('setServerSettings', serverSettings)
|
||||
this.$store.commit('setSource', Source)
|
||||
this.$store.commit('libraries/setEReaderDevices', ereaderDevices)
|
||||
this.$store.commit('setPlugins', plugins)
|
||||
if (plugins !== undefined) {
|
||||
this.$store.commit('setPlugins', plugins)
|
||||
}
|
||||
|
||||
this.$setServerLanguageCode(serverSettings.language)
|
||||
|
||||
if (serverSettings.chromecastEnabled) {
|
||||
|
||||
@@ -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
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user