X-Git-Url: https://git.immae.eu/?a=blobdiff_plain;f=server%2Flib%2Fclient-html.ts;h=8841dd2ac2a69f02e88c26eb0caf3760cf49c851;hb=c5407d7046168abb4098df1408e7aa84519cb61a;hp=1e78972205c5e65d588e4e7ad315a91af1cc49ea;hpb=a8b666e9f1ed002230869606308749614390c82f;p=github%2FChocobozzz%2FPeerTube.git diff --git a/server/lib/client-html.ts b/server/lib/client-html.ts index 1e7897220..8841dd2ac 100644 --- a/server/lib/client-html.ts +++ b/server/lib/client-html.ts @@ -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 = ``