1
0
Fork 0
mirror of https://github.com/Chocobozzz/PeerTube.git synced 2025-10-05 19:42:24 +02:00

Stronger model typings

This commit is contained in:
Chocobozzz 2019-08-15 11:53:26 +02:00
parent 13176a07a9
commit 453e83ea5d
No known key found for this signature in database
GPG key ID: 583A612D890159BE
176 changed files with 2118 additions and 1133 deletions

View file

@ -13,6 +13,7 @@ import { VideoChannelModel } from '../models/video/video-channel'
import * as Bluebird from 'bluebird'
import { CONFIG } from '../initializers/config'
import { logger } from '../helpers/logger'
import { MAccountActor, MChannelActor, MVideo } from '../typings/models'
export class ClientHtml {
@ -65,7 +66,7 @@ export class ClientHtml {
}
private static async getAccountOrChannelHTMLPage (
loader: () => Bluebird<AccountModel | VideoChannelModel>,
loader: () => Bluebird<MAccountActor | MChannelActor>,
req: express.Request,
res: express.Response
) {
@ -157,7 +158,7 @@ export class ClientHtml {
return htmlStringPage.replace('</head>', linkTag + '</head>')
}
private static addVideoOpenGraphAndOEmbedTags (htmlStringPage: string, video: VideoModel) {
private static addVideoOpenGraphAndOEmbedTags (htmlStringPage: string, video: MVideo) {
const previewUrl = WEBSERVER.URL + video.getPreviewStaticPath()
const videoUrl = WEBSERVER.URL + video.getWatchStaticPath()
@ -236,7 +237,7 @@ export class ClientHtml {
return this.addOpenGraphAndOEmbedTags(htmlStringPage, tagsString)
}
private static addAccountOrChannelMetaTags (htmlStringPage: string, entity: AccountModel | VideoChannelModel) {
private static addAccountOrChannelMetaTags (htmlStringPage: string, entity: MAccountActor | MChannelActor) {
// SEO, use origin account or channel URL
const metaTags = `<link rel="canonical" href="${entity.Actor.url}" />`