import { Hooks } from './server/lib/plugins/hooks'
import { PluginManager } from './server/lib/plugins/plugin-manager'
import { LiveManager } from './server/lib/live'
-import { HttpStatusCode } from './shared/core-utils/miscs/http-error-codes'
+import { HttpStatusCode } from './shared/models/http/http-error-codes'
import { VideosTorrentCache } from '@server/lib/files-cache/videos-torrent-cache'
import { ServerConfigManager } from '@server/lib/server-config-manager'
updateStreamingPlaylistsInfohashesIfNeeded()
.catch(err => logger.error('Cannot update streaming playlist infohashes.', { err }))
- if (cliOptions.plugins) await PluginManager.Instance.registerPluginsAndThemes()
-
LiveManager.Instance.init()
if (CONFIG.LIVE.ENABLED) LiveManager.Instance.run()
// Make server listening
- server.listen(port, hostname, () => {
+ server.listen(port, hostname, async () => {
+ if (cliOptions.plugins) {
+ try {
+ await PluginManager.Instance.registerPluginsAndThemes()
+ } catch (err) {
+ logger.error('Cannot register plugins and themes.', { err })
+ }
+ }
+
logger.info('HTTP server listening on %s:%d', hostname, port)
logger.info('Web server: %s', WEBSERVER.URL)