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

Use indexifembedded for embeds

This commit is contained in:
Chocobozzz 2025-03-31 16:34:41 +02:00
parent 5ce0b0f65d
commit f0f44e1704
No known key found for this signature in database
GPG key ID: 583A612D890159BE
7 changed files with 56 additions and 48 deletions

View file

@ -15,7 +15,6 @@ import { PageHtml } from './page-html.js'
import { TagsHtml } from './tags-html.js'
export class VideoHtml {
static async getWatchVideoHTML (videoIdArg: string, req: express.Request, res: express.Response) {
const videoId = toCompleteUUID(videoIdArg)
@ -42,7 +41,8 @@ export class VideoHtml {
currentQuery: req.query,
addEmbedInfo: true,
addOG: true,
addTwitterCard: true
addTwitterCard: true,
isEmbed: false
})
}
@ -66,6 +66,7 @@ export class VideoHtml {
addEmbedInfo: true,
addOG: false,
addTwitterCard: false,
isEmbed: true,
// TODO: Implement it so we can send query params to oembed service
currentQuery: {}
@ -84,9 +85,11 @@ export class VideoHtml {
addTwitterCard: boolean
addEmbedInfo: boolean
isEmbed: boolean
currentQuery: Record<string, string>
}) {
const { html, video, addEmbedInfo, addOG, addTwitterCard, currentQuery = {} } = options
const { html, video, addEmbedInfo, addOG, addTwitterCard, isEmbed, currentQuery = {} } = options
const escapedTruncatedDescription = TagsHtml.buildEscapedTruncatedDescription(video.description)
let customHTML = TagsHtml.addTitleTag(html, video.name)
@ -120,7 +123,11 @@ export class VideoHtml {
escapedTitle: escapeHTML(video.name),
escapedTruncatedDescription,
forbidIndexation: video.remote || video.privacy !== VideoPrivacy.PUBLIC,
forbidIndexation: isEmbed
? video.privacy !== VideoPrivacy.PUBLIC && video.privacy !== VideoPrivacy.UNLISTED
: video.remote || video.privacy !== VideoPrivacy.PUBLIC,
embedIndexation: isEmbed,
image: preview
? { url: WEBSERVER.URL + video.getPreviewStaticPath(), width: preview.width, height: preview.height }