mirror of
https://github.com/Chocobozzz/PeerTube.git
synced 2025-10-04 18:29:27 +02:00
Merge branch 'release/7.2.0' into develop
This commit is contained in:
commit
037197a7e9
16 changed files with 138 additions and 96 deletions
|
@ -18,22 +18,22 @@ class ClientHtml {
|
|||
|
||||
// ---------------------------------------------------------------------------
|
||||
|
||||
static getWatchHTMLPage (videoIdArg: string, req: express.Request, res: express.Response) {
|
||||
return VideoHtml.getWatchVideoHTML(videoIdArg, req, res)
|
||||
static getWatchHTMLPage (videoId: string, req: express.Request, res: express.Response) {
|
||||
return VideoHtml.getWatchVideoHTML(videoId, req, res)
|
||||
}
|
||||
|
||||
static getVideoEmbedHTML (videoIdArg: string) {
|
||||
return VideoHtml.getEmbedVideoHTML(videoIdArg)
|
||||
static getVideoEmbedHTML (videoId: string) {
|
||||
return VideoHtml.getEmbedVideoHTML(videoId)
|
||||
}
|
||||
|
||||
// ---------------------------------------------------------------------------
|
||||
|
||||
static getWatchPlaylistHTMLPage (videoPlaylistIdArg: string, req: express.Request, res: express.Response) {
|
||||
return PlaylistHtml.getWatchPlaylistHTML(videoPlaylistIdArg, req, res)
|
||||
static getWatchPlaylistHTMLPage (videoPlaylistId: string, req: express.Request, res: express.Response) {
|
||||
return PlaylistHtml.getWatchPlaylistHTML(videoPlaylistId, req, res)
|
||||
}
|
||||
|
||||
static getVideoPlaylistEmbedHTML (playlistIdArg: string) {
|
||||
return PlaylistHtml.getEmbedPlaylistHTML(playlistIdArg)
|
||||
static getVideoPlaylistEmbedHTML (playlistId: string) {
|
||||
return PlaylistHtml.getEmbedPlaylistHTML(playlistId)
|
||||
}
|
||||
|
||||
// ---------------------------------------------------------------------------
|
||||
|
|
|
@ -1,6 +1,5 @@
|
|||
import { addQueryParams, escapeHTML, getDefaultRSSFeeds } from '@peertube/peertube-core-utils'
|
||||
import { HttpStatusCode, VideoPlaylistPrivacy } from '@peertube/peertube-models'
|
||||
import { toCompleteUUID } from '@server/helpers/custom-validators/misc.js'
|
||||
import { Memoize } from '@server/helpers/memoize.js'
|
||||
import { VideoPlaylistModel } from '@server/models/video/video-playlist.js'
|
||||
import { MVideoPlaylist, MVideoPlaylistFull } from '@server/types/models/index.js'
|
||||
|
@ -13,9 +12,7 @@ import { PageHtml } from './page-html.js'
|
|||
import { TagsHtml } from './tags-html.js'
|
||||
|
||||
export class PlaylistHtml {
|
||||
static async getWatchPlaylistHTML (videoPlaylistIdArg: string, req: express.Request, res: express.Response) {
|
||||
const videoPlaylistId = toCompleteUUID(videoPlaylistIdArg)
|
||||
|
||||
static async getWatchPlaylistHTML (videoPlaylistId: string, req: express.Request, res: express.Response) {
|
||||
// Let Angular application handle errors
|
||||
if (!validator.default.isInt(videoPlaylistId) && !validator.default.isUUID(videoPlaylistId, 4)) {
|
||||
res.status(HttpStatusCode.NOT_FOUND_404)
|
||||
|
@ -46,9 +43,7 @@ export class PlaylistHtml {
|
|||
}
|
||||
|
||||
@Memoize({ maxAge: MEMOIZE_TTL.EMBED_HTML })
|
||||
static async getEmbedPlaylistHTML (playlistIdArg: string) {
|
||||
const playlistId = toCompleteUUID(playlistIdArg)
|
||||
|
||||
static async getEmbedPlaylistHTML (playlistId: string) {
|
||||
const playlistPromise: Promise<MVideoPlaylistFull> = validator.default.isInt(playlistId) || validator.default.isUUID(playlistId, 4)
|
||||
? VideoPlaylistModel.loadWithAccountAndChannel(playlistId, null)
|
||||
: Promise.resolve(undefined)
|
||||
|
|
|
@ -1,6 +1,5 @@
|
|||
import { addQueryParams, escapeHTML, getVideoWatchRSSFeeds } from '@peertube/peertube-core-utils'
|
||||
import { HttpStatusCode, VideoPrivacy } from '@peertube/peertube-models'
|
||||
import { toCompleteUUID } from '@server/helpers/custom-validators/misc.js'
|
||||
import { Memoize } from '@server/helpers/memoize.js'
|
||||
import express from 'express'
|
||||
import validator from 'validator'
|
||||
|
@ -15,9 +14,7 @@ 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)
|
||||
|
||||
static async getWatchVideoHTML (videoId: string, req: express.Request, res: express.Response) {
|
||||
// Let Angular application handle errors
|
||||
if (!validator.default.isInt(videoId) && !validator.default.isUUID(videoId, 4)) {
|
||||
res.status(HttpStatusCode.NOT_FOUND_404)
|
||||
|
@ -47,9 +44,7 @@ export class VideoHtml {
|
|||
}
|
||||
|
||||
@Memoize({ maxAge: MEMOIZE_TTL.EMBED_HTML })
|
||||
static async getEmbedVideoHTML (videoIdArg: string) {
|
||||
const videoId = toCompleteUUID(videoIdArg)
|
||||
|
||||
static async getEmbedVideoHTML (videoId: string) {
|
||||
const videoPromise: Promise<MVideoThumbnailBlacklist> = validator.default.isInt(videoId) || validator.default.isUUID(videoId, 4)
|
||||
? VideoModel.loadWithBlacklist(videoId)
|
||||
: Promise.resolve(undefined)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue