From 15a7eafb892441957ba7dd6fcbf556086fe5b2b3 Mon Sep 17 00:00:00 2001 From: Chocobozzz Date: Mon, 26 Jul 2021 15:04:37 +0200 Subject: Refactor video links builders --- server/models/video/video-playlist.ts | 8 ++++---- server/models/video/video.ts | 7 ++++--- 2 files changed, 8 insertions(+), 7 deletions(-) (limited to 'server/models') diff --git a/server/models/video/video-playlist.ts b/server/models/video/video-playlist.ts index af81c9906..245475f94 100644 --- a/server/models/video/video-playlist.ts +++ b/server/models/video/video-playlist.ts @@ -20,7 +20,7 @@ import { import { setAsUpdated } from '@server/helpers/database-utils' import { buildUUID, uuidToShort } from '@server/helpers/uuid' import { MAccountId, MChannelId } from '@server/types/models' -import { AttributesOnly } from '@shared/core-utils' +import { AttributesOnly, buildPlaylistEmbedPath, buildPlaylistLink, buildPlaylistWatchPath } from '@shared/core-utils' import { ActivityIconObject } from '../../../shared/models/activitypub/objects' import { PlaylistObject } from '../../../shared/models/activitypub/objects/playlist-object' import { VideoPlaylistPrivacy } from '../../../shared/models/videos/playlist/video-playlist-privacy.model' @@ -560,12 +560,12 @@ export class VideoPlaylistModel extends Model>> { } getWatchStaticPath () { - return '/w/' + this.uuid + return buildVideoWatchPath({ shortUUID: shortToUUID(this.uuid) }) } getEmbedStaticPath () { - return '/videos/embed/' + this.uuid + return buildVideoEmbedPath(this) } getMiniatureStaticPath () { -- cgit v1.2.3