mirror of
https://github.com/advplyr/audiobookshelf.git
synced 2026-06-06 02:32:44 +02:00
Update PluginManager to singleton, update PluginContext, support prompt object in plugin extension
This commit is contained in:
+11
-1
@@ -940,7 +940,17 @@ class Auth {
|
||||
userDefaultLibraryId: user.getDefaultLibraryId(libraryIds),
|
||||
serverSettings: Database.serverSettings.toJSONForBrowser(),
|
||||
ereaderDevices: Database.emailSettings.getEReaderDevices(user),
|
||||
plugins: this.pluginManifests,
|
||||
// TODO: Should be better handled by the PluginManager
|
||||
// restrict plugin extensions that are not allowed for the user type
|
||||
plugins: this.pluginManifests.map((manifest) => {
|
||||
const manifestExtensions = (manifest.extensions || []).filter((ext) => {
|
||||
if (ext.restrictToAccountTypes?.length) {
|
||||
return ext.restrictToAccountTypes.includes(user.type)
|
||||
}
|
||||
return true
|
||||
})
|
||||
return { ...manifest, extensions: manifestExtensions }
|
||||
}),
|
||||
Source: global.Source
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user