diff options
Diffstat (limited to 'server/lib')
-rw-r--r-- | server/lib/client-html.ts | 5 | ||||
-rw-r--r-- | server/lib/plugins/plugin-manager.ts | 8 |
2 files changed, 6 insertions, 7 deletions
diff --git a/server/lib/client-html.ts b/server/lib/client-html.ts index 0142b248b..38697401a 100644 --- a/server/lib/client-html.ts +++ b/server/lib/client-html.ts | |||
@@ -12,7 +12,6 @@ import { HTMLServerConfig } from '@shared/models' | |||
12 | import { buildFileLocale, getDefaultLocale, is18nLocale, POSSIBLE_LOCALES } from '../../shared/core-utils/i18n/i18n' | 12 | import { buildFileLocale, getDefaultLocale, is18nLocale, POSSIBLE_LOCALES } from '../../shared/core-utils/i18n/i18n' |
13 | import { HttpStatusCode } from '../../shared/models/http/http-error-codes' | 13 | import { HttpStatusCode } from '../../shared/models/http/http-error-codes' |
14 | import { VideoPlaylistPrivacy, VideoPrivacy } from '../../shared/models/videos' | 14 | import { VideoPlaylistPrivacy, VideoPrivacy } from '../../shared/models/videos' |
15 | import { isTestInstance } from '../helpers/core-utils' | ||
16 | import { logger } from '../helpers/logger' | 15 | import { logger } from '../helpers/logger' |
17 | import { CONFIG } from '../initializers/config' | 16 | import { CONFIG } from '../initializers/config' |
18 | import { | 17 | import { |
@@ -231,7 +230,7 @@ class ClientHtml { | |||
231 | static async getEmbedHTML () { | 230 | static async getEmbedHTML () { |
232 | const path = ClientHtml.getEmbedPath() | 231 | const path = ClientHtml.getEmbedPath() |
233 | 232 | ||
234 | if (!isTestInstance() && ClientHtml.htmlCache[path]) return ClientHtml.htmlCache[path] | 233 | if (ClientHtml.htmlCache[path]) return ClientHtml.htmlCache[path] |
235 | 234 | ||
236 | const buffer = await readFile(path) | 235 | const buffer = await readFile(path) |
237 | const serverConfig = await ServerConfigManager.Instance.getHTMLServerConfig() | 236 | const serverConfig = await ServerConfigManager.Instance.getHTMLServerConfig() |
@@ -303,7 +302,7 @@ class ClientHtml { | |||
303 | 302 | ||
304 | private static async getIndexHTML (req: express.Request, res: express.Response, paramLang?: string) { | 303 | private static async getIndexHTML (req: express.Request, res: express.Response, paramLang?: string) { |
305 | const path = ClientHtml.getIndexPath(req, res, paramLang) | 304 | const path = ClientHtml.getIndexPath(req, res, paramLang) |
306 | if (!isTestInstance() && ClientHtml.htmlCache[path]) return ClientHtml.htmlCache[path] | 305 | if (ClientHtml.htmlCache[path]) return ClientHtml.htmlCache[path] |
307 | 306 | ||
308 | const buffer = await readFile(path) | 307 | const buffer = await readFile(path) |
309 | const serverConfig = await ServerConfigManager.Instance.getHTMLServerConfig() | 308 | const serverConfig = await ServerConfigManager.Instance.getHTMLServerConfig() |
diff --git a/server/lib/plugins/plugin-manager.ts b/server/lib/plugins/plugin-manager.ts index 39e7f9a5b..1305f660f 100644 --- a/server/lib/plugins/plugin-manager.ts +++ b/server/lib/plugins/plugin-manager.ts | |||
@@ -277,6 +277,8 @@ export class PluginManager implements ServerHook { | |||
277 | logger.info('Regenerating registered plugin CSS to global file.') | 277 | logger.info('Regenerating registered plugin CSS to global file.') |
278 | await this.regeneratePluginGlobalCSS() | 278 | await this.regeneratePluginGlobalCSS() |
279 | } | 279 | } |
280 | |||
281 | ClientHtml.invalidCache() | ||
280 | } | 282 | } |
281 | 283 | ||
282 | // ###################### Installation ###################### | 284 | // ###################### Installation ###################### |
@@ -419,6 +421,8 @@ export class PluginManager implements ServerHook { | |||
419 | } | 421 | } |
420 | 422 | ||
421 | await this.addTranslations(plugin, npmName, packageJSON.translations) | 423 | await this.addTranslations(plugin, npmName, packageJSON.translations) |
424 | |||
425 | ClientHtml.invalidCache() | ||
422 | } | 426 | } |
423 | 427 | ||
424 | private async registerPlugin (plugin: PluginModel, pluginPath: string, packageJSON: PluginPackageJSON) { | 428 | private async registerPlugin (plugin: PluginModel, pluginPath: string, packageJSON: PluginPackageJSON) { |
@@ -473,8 +477,6 @@ export class PluginManager implements ServerHook { | |||
473 | // ###################### CSS ###################### | 477 | // ###################### CSS ###################### |
474 | 478 | ||
475 | private resetCSSGlobalFile () { | 479 | private resetCSSGlobalFile () { |
476 | ClientHtml.invalidCache() | ||
477 | |||
478 | return outputFile(PLUGIN_GLOBAL_CSS_PATH, '') | 480 | return outputFile(PLUGIN_GLOBAL_CSS_PATH, '') |
479 | } | 481 | } |
480 | 482 | ||
@@ -482,8 +484,6 @@ export class PluginManager implements ServerHook { | |||
482 | for (const cssPath of cssRelativePaths) { | 484 | for (const cssPath of cssRelativePaths) { |
483 | await this.concatFiles(join(pluginPath, cssPath), PLUGIN_GLOBAL_CSS_PATH) | 485 | await this.concatFiles(join(pluginPath, cssPath), PLUGIN_GLOBAL_CSS_PATH) |
484 | } | 486 | } |
485 | |||
486 | ClientHtml.invalidCache() | ||
487 | } | 487 | } |
488 | 488 | ||
489 | private concatFiles (input: string, output: string) { | 489 | private concatFiles (input: string, output: string) { |