} from '@shared/models'
import { environment } from '../../../environments/environment'
import { RegisterClientHelpers } from '../../../types/register-client-option.model'
+import * as debug from 'debug'
+
+const logger = debug('peertube:plugins')
@Injectable()
export class PluginService implements ClientHook {
}
initializePlugins () {
+ logger('Building plugin configuration')
+
this.server.getConfig()
.subscribe(config => {
this.plugins = config.plugin.registered
this.buildScopeStruct()
this.pluginsBuilt.next(true)
+
+ logger('Plugin configuration built')
})
}
this.loadingScopes[scope] = true
+ logger('Loading scope %s', scope)
+
try {
await this.ensurePluginsAreBuilt()
this.loadingScopes[scope] = false
this.pluginsLoaded[scope].next(true)
+ logger('Nothing to load for scope %s', scope)
return
}
this.pluginsLoaded[scope].next(true)
this.loadingScopes[scope] = false
+
+ logger('Scope %s loaded', scope)
} catch (err) {
console.error('Cannot load plugins by scope %s.', scope, err)
}