]> git.immae.eu Git - github/Chocobozzz/PeerTube.git/blobdiff - server/lib/plugins/plugin-manager.ts
Fix schema.org context
[github/Chocobozzz/PeerTube.git] / server / lib / plugins / plugin-manager.ts
index ff00ab9e8b5bd2d164fb63e3fbccd894380a8f90..1305f660ff3333ff1c0feec816dd8770c51a85c6 100644 (file)
@@ -5,7 +5,13 @@ import { basename, join } from 'path'
 import { decachePlugin } from '@server/helpers/decache'
 import { MOAuthTokenUser, MUser } from '@server/types/models'
 import { getCompleteLocale } from '@shared/core-utils'
-import { ClientScriptJSON, PluginPackageJSON, PluginTranslation, PluginTranslationPathsJSON, RegisterServerHookOptions } from '@shared/models'
+import {
+  ClientScriptJSON,
+  PluginPackageJSON,
+  PluginTranslation,
+  PluginTranslationPathsJSON,
+  RegisterServerHookOptions
+} from '@shared/models'
 import { getHookType, internalRunHook } from '../../../shared/core-utils/plugins/hooks'
 import { PluginType } from '../../../shared/models/plugins/plugin.type'
 import { ServerHook, ServerHookName } from '../../../shared/models/plugins/server/server-hook.model'
@@ -271,6 +277,8 @@ export class PluginManager implements ServerHook {
       logger.info('Regenerating registered plugin CSS to global file.')
       await this.regeneratePluginGlobalCSS()
     }
+
+    ClientHtml.invalidCache()
   }
 
   // ###################### Installation ######################
@@ -413,6 +421,8 @@ export class PluginManager implements ServerHook {
     }
 
     await this.addTranslations(plugin, npmName, packageJSON.translations)
+
+    ClientHtml.invalidCache()
   }
 
   private async registerPlugin (plugin: PluginModel, pluginPath: string, packageJSON: PluginPackageJSON) {
@@ -467,8 +477,6 @@ export class PluginManager implements ServerHook {
   // ###################### CSS ######################
 
   private resetCSSGlobalFile () {
-    ClientHtml.invalidCache()
-
     return outputFile(PLUGIN_GLOBAL_CSS_PATH, '')
   }
 
@@ -476,8 +484,6 @@ export class PluginManager implements ServerHook {
     for (const cssPath of cssRelativePaths) {
       await this.concatFiles(join(pluginPath, cssPath), PLUGIN_GLOBAL_CSS_PATH)
     }
-
-    ClientHtml.invalidCache()
   }
 
   private concatFiles (input: string, output: string) {