aboutsummaryrefslogtreecommitdiffhomepage
path: root/client
diff options
context:
space:
mode:
Diffstat (limited to 'client')
-rw-r--r--client/src/app/core/plugins/plugin.service.ts12
1 files changed, 12 insertions, 0 deletions
diff --git a/client/src/app/core/plugins/plugin.service.ts b/client/src/app/core/plugins/plugin.service.ts
index a3de98390..dff8ad864 100644
--- a/client/src/app/core/plugins/plugin.service.ts
+++ b/client/src/app/core/plugins/plugin.service.ts
@@ -24,6 +24,9 @@ import {
24} from '@shared/models' 24} from '@shared/models'
25import { environment } from '../../../environments/environment' 25import { environment } from '../../../environments/environment'
26import { RegisterClientHelpers } from '../../../types/register-client-option.model' 26import { RegisterClientHelpers } from '../../../types/register-client-option.model'
27import * as debug from 'debug'
28
29const logger = debug('peertube:plugins')
27 30
28@Injectable() 31@Injectable()
29export class PluginService implements ClientHook { 32export class PluginService implements ClientHook {
@@ -76,6 +79,8 @@ export class PluginService implements ClientHook {
76 } 79 }
77 80
78 initializePlugins () { 81 initializePlugins () {
82 logger('Building plugin configuration')
83
79 this.server.getConfig() 84 this.server.getConfig()
80 .subscribe(config => { 85 .subscribe(config => {
81 this.plugins = config.plugin.registered 86 this.plugins = config.plugin.registered
@@ -83,6 +88,8 @@ export class PluginService implements ClientHook {
83 this.buildScopeStruct() 88 this.buildScopeStruct()
84 89
85 this.pluginsBuilt.next(true) 90 this.pluginsBuilt.next(true)
91
92 logger('Plugin configuration built')
86 }) 93 })
87 } 94 }
88 95
@@ -146,6 +153,8 @@ export class PluginService implements ClientHook {
146 153
147 this.loadingScopes[scope] = true 154 this.loadingScopes[scope] = true
148 155
156 logger('Loading scope %s', scope)
157
149 try { 158 try {
150 await this.ensurePluginsAreBuilt() 159 await this.ensurePluginsAreBuilt()
151 160
@@ -156,6 +165,7 @@ export class PluginService implements ClientHook {
156 this.loadingScopes[scope] = false 165 this.loadingScopes[scope] = false
157 this.pluginsLoaded[scope].next(true) 166 this.pluginsLoaded[scope].next(true)
158 167
168 logger('Nothing to load for scope %s', scope)
159 return 169 return
160 } 170 }
161 171
@@ -174,6 +184,8 @@ export class PluginService implements ClientHook {
174 184
175 this.pluginsLoaded[scope].next(true) 185 this.pluginsLoaded[scope].next(true)
176 this.loadingScopes[scope] = false 186 this.loadingScopes[scope] = false
187
188 logger('Scope %s loaded', scope)
177 } catch (err) { 189 } catch (err) {
178 console.error('Cannot load plugins by scope %s.', scope, err) 190 console.error('Cannot load plugins by scope %s.', scope, err)
179 } 191 }