aboutsummaryrefslogtreecommitdiffhomepage
path: root/server/models/video/video.ts
diff options
context:
space:
mode:
authorChocobozzz <me@florianbigard.com>2021-07-26 15:04:37 +0200
committerChocobozzz <me@florianbigard.com>2021-07-26 15:04:37 +0200
commit15a7eafb892441957ba7dd6fcbf556086fe5b2b3 (patch)
tree0786bd1a96c7d168a097ffcf5893737db2ab578e /server/models/video/video.ts
parent9162fdd36300d2478f13d6ad346ec2c323f40faa (diff)
downloadPeerTube-15a7eafb892441957ba7dd6fcbf556086fe5b2b3.tar.gz
PeerTube-15a7eafb892441957ba7dd6fcbf556086fe5b2b3.tar.zst
PeerTube-15a7eafb892441957ba7dd6fcbf556086fe5b2b3.zip
Refactor video links builders
Diffstat (limited to 'server/models/video/video.ts')
-rw-r--r--server/models/video/video.ts7
1 files changed, 4 insertions, 3 deletions
diff --git a/server/models/video/video.ts b/server/models/video/video.ts
index 0f0f894e4..543e604bb 100644
--- a/server/models/video/video.ts
+++ b/server/models/video/video.ts
@@ -26,12 +26,13 @@ import {
26} from 'sequelize-typescript' 26} from 'sequelize-typescript'
27import { setAsUpdated } from '@server/helpers/database-utils' 27import { setAsUpdated } from '@server/helpers/database-utils'
28import { buildNSFWFilter } from '@server/helpers/express-utils' 28import { buildNSFWFilter } from '@server/helpers/express-utils'
29import { shortToUUID } from '@server/helpers/uuid'
29import { getPrivaciesForFederation, isPrivacyForFederation, isStateForFederation } from '@server/helpers/video' 30import { getPrivaciesForFederation, isPrivacyForFederation, isStateForFederation } from '@server/helpers/video'
30import { LiveManager } from '@server/lib/live/live-manager' 31import { LiveManager } from '@server/lib/live/live-manager'
31import { getHLSDirectory, getVideoFilePath } from '@server/lib/video-paths' 32import { getHLSDirectory, getVideoFilePath } from '@server/lib/video-paths'
32import { getServerActor } from '@server/models/application/application' 33import { getServerActor } from '@server/models/application/application'
33import { ModelCache } from '@server/models/model-cache' 34import { ModelCache } from '@server/models/model-cache'
34import { AttributesOnly } from '@shared/core-utils' 35import { AttributesOnly, buildVideoEmbedPath, buildVideoWatchPath } from '@shared/core-utils'
35import { VideoFile } from '@shared/models/videos/video-file.model' 36import { VideoFile } from '@shared/models/videos/video-file.model'
36import { ResultList, UserRight, VideoPrivacy, VideoState } from '../../../shared' 37import { ResultList, UserRight, VideoPrivacy, VideoState } from '../../../shared'
37import { VideoObject } from '../../../shared/models/activitypub/objects' 38import { VideoObject } from '../../../shared/models/activitypub/objects'
@@ -1578,11 +1579,11 @@ export class VideoModel extends Model<Partial<AttributesOnly<VideoModel>>> {
1578 } 1579 }
1579 1580
1580 getWatchStaticPath () { 1581 getWatchStaticPath () {
1581 return '/w/' + this.uuid 1582 return buildVideoWatchPath({ shortUUID: shortToUUID(this.uuid) })
1582 } 1583 }
1583 1584
1584 getEmbedStaticPath () { 1585 getEmbedStaticPath () {
1585 return '/videos/embed/' + this.uuid 1586 return buildVideoEmbedPath(this)
1586 } 1587 }
1587 1588
1588 getMiniatureStaticPath () { 1589 getMiniatureStaticPath () {