1
0
Fork 0
mirror of https://github.com/Chocobozzz/PeerTube.git synced 2025-10-03 17:59:37 +02:00

Add instance avatar to default open graph tags

This commit is contained in:
Chocobozzz 2024-10-22 13:12:06 +02:00
parent 5af6cf6e82
commit 54adc6f038
No known key found for this signature in database
GPG key ID: 583A612D890159BE
14 changed files with 119 additions and 49 deletions

View file

@ -7,7 +7,7 @@ import validator from 'validator'
import { CONFIG } from '../../../initializers/config.js'
import { MEMOIZE_TTL, WEBSERVER } from '../../../initializers/constants.js'
import { VideoModel } from '../../../models/video/video.js'
import { MVideo, MVideoThumbnailBlacklist } from '../../../types/models/index.js'
import { MVideo, MVideoThumbnail, MVideoThumbnailBlacklist } from '../../../types/models/index.js'
import { getActivityStreamDuration } from '../../activitypub/activity.js'
import { isVideoInPrivateDirectory } from '../../video-privacy.js'
import { CommonEmbedHtml } from './common-embed-html.js'
@ -78,7 +78,7 @@ export class VideoHtml {
private static buildVideoHTML (options: {
html: string
video: MVideo
video: MVideoThumbnail
addOG: boolean
addTwitterCard: boolean
@ -111,6 +111,8 @@ export class VideoHtml {
const schemaType = 'VideoObject'
const preview = video.getPreview()
return TagsHtml.addTags(customHTML, {
url: WEBSERVER.URL + video.getWatchStaticPath(),
@ -118,11 +120,11 @@ export class VideoHtml {
escapedTitle: escapeHTML(video.name),
escapedTruncatedDescription,
indexationPolicy: video.remote || video.privacy !== VideoPrivacy.PUBLIC
? 'never'
: 'always',
forbidIndexation: video.remote || video.privacy !== VideoPrivacy.PUBLIC,
image: { url: WEBSERVER.URL + video.getPreviewStaticPath() },
image: preview
? { url: WEBSERVER.URL + video.getPreviewStaticPath(), width: preview.width, height: preview.height }
: undefined,
embed,
oembedUrl: this.getOEmbedUrl(video, currentQuery),