]> git.immae.eu Git - github/Chocobozzz/PeerTube.git/blobdiff - server/lib/client-html.ts
Fix playlist more button with long video names
[github/Chocobozzz/PeerTube.git] / server / lib / client-html.ts
index 1e78972205c5e65d588e4e7ad315a91af1cc49ea..8841dd2ac2a69f02e88c26eb0caf3760cf49c851 100644 (file)
@@ -12,12 +12,15 @@ import { AccountModel } from '../models/account/account'
 import { VideoChannelModel } from '../models/video/video-channel'
 import * as Bluebird from 'bluebird'
 import { CONFIG } from '../initializers/config'
+import { logger } from '../helpers/logger'
 
 export class ClientHtml {
 
   private static htmlCache: { [ path: string ]: string } = {}
 
   static invalidCache () {
+    logger.info('Cleaning HTML cache.')
+
     ClientHtml.htmlCache = {}
   }
 
@@ -38,7 +41,7 @@ export class ClientHtml {
 
     const [ html, video ] = await Promise.all([
       ClientHtml.getIndexHTML(req, res),
-      VideoModel.loadAndPopulateAccountAndServerAndTags(videoId)
+      VideoModel.load(videoId)
     ])
 
     // Let Angular application handle errors
@@ -146,7 +149,7 @@ export class ClientHtml {
 
   private static async addAsyncPluginCSS (htmlStringPage: string) {
     const globalCSSContent = await readFile(PLUGIN_GLOBAL_CSS_PATH)
-    if (!globalCSSContent) return htmlStringPage
+    if (globalCSSContent.byteLength === 0) return htmlStringPage
 
     const fileHash = sha256(globalCSSContent)
     const linkTag = `<link rel="stylesheet" href="/plugins/global.css?hash=${fileHash}" />`