From 8efc27bf14f1fe3ed23cd8a6d2de1f0918a7f769 Mon Sep 17 00:00:00 2001 From: Chocobozzz Date: Thu, 18 Feb 2021 11:28:00 +0100 Subject: Cleanup --- server/models/video/thumbnail.ts | 4 ++-- server/models/video/video-caption.ts | 4 ++-- server/models/video/video-file.ts | 4 ++-- server/models/video/video-format-utils.ts | 6 +++--- 4 files changed, 9 insertions(+), 9 deletions(-) (limited to 'server/models') diff --git a/server/models/video/thumbnail.ts b/server/models/video/thumbnail.ts index 319e1175a..f1187c8d6 100644 --- a/server/models/video/thumbnail.ts +++ b/server/models/video/thumbnail.ts @@ -16,7 +16,7 @@ import { UpdatedAt } from 'sequelize-typescript' import { afterCommitIfTransaction } from '@server/helpers/database-utils' -import { MThumbnail, MThumbnailVideo, MVideoWithHost } from '@server/types/models' +import { MThumbnail, MThumbnailVideo, MVideo } from '@server/types/models' import { ThumbnailType } from '../../../shared/models/videos/thumbnail.type' import { logger } from '../../helpers/logger' import { CONFIG } from '../../initializers/config' @@ -163,7 +163,7 @@ export class ThumbnailModel extends Model { return join(directory, filename) } - getFileUrl (video: MVideoWithHost) { + getFileUrl (video: MVideo) { const staticPath = ThumbnailModel.types[this.type].staticPath + this.filename if (video.isOwned()) return WEBSERVER.URL + staticPath diff --git a/server/models/video/video-caption.ts b/server/models/video/video-caption.ts index 0bbe9b752..bfdec73e9 100644 --- a/server/models/video/video-caption.ts +++ b/server/models/video/video-caption.ts @@ -16,7 +16,7 @@ import { UpdatedAt } from 'sequelize-typescript' import { v4 as uuidv4 } from 'uuid' -import { MVideoCaption, MVideoCaptionFormattable, MVideoCaptionVideo, MVideoWithHost } from '@server/types/models' +import { MVideo, MVideoCaption, MVideoCaptionFormattable, MVideoCaptionVideo } from '@server/types/models' import { VideoCaption } from '../../../shared/models/videos/caption/video-caption.model' import { isVideoCaptionLanguageValid } from '../../helpers/custom-validators/video-captions' import { logger } from '../../helpers/logger' @@ -203,7 +203,7 @@ export class VideoCaptionModel extends Model { return remove(CONFIG.STORAGE.CAPTIONS_DIR + this.filename) } - getFileUrl (video: MVideoWithHost) { + getFileUrl (video: MVideo) { if (!this.Video) this.Video = video as VideoModel if (video.isOwned()) return WEBSERVER.URL + this.getCaptionStaticPath() diff --git a/server/models/video/video-file.ts b/server/models/video/video-file.ts index 5a3706259..4df2c20bc 100644 --- a/server/models/video/video-file.ts +++ b/server/models/video/video-file.ts @@ -423,7 +423,7 @@ export class VideoFileModel extends Model { return !!this.videoStreamingPlaylistId } - getFileUrl (video: MVideoWithHost) { + getFileUrl (video: MVideo) { if (!this.Video) this.Video = video as VideoModel if (video.isOwned()) return WEBSERVER.URL + this.getFileStaticPath(video) @@ -449,7 +449,7 @@ export class VideoFileModel extends Model { return buildRemoteVideoBaseUrl(video, path) } - getRemoteTorrentUrl (video: MVideoWithHost) { + getRemoteTorrentUrl (video: MVideo) { if (video.isOwned()) throw new Error(`Video ${video.url} is not a remote video`) return this.torrentUrl diff --git a/server/models/video/video-format-utils.ts b/server/models/video/video-format-utils.ts index 455597d22..a6a1a4f0d 100644 --- a/server/models/video/video-format-utils.ts +++ b/server/models/video/video-format-utils.ts @@ -14,11 +14,11 @@ import { } from '../../lib/activitypub/url' import { MStreamingPlaylistRedundanciesOpt, + MVideo, MVideoAP, MVideoFile, MVideoFormattable, - MVideoFormattableDetails, - MVideoWithHost + MVideoFormattableDetails } from '../../types/models' import { MVideoFileRedundanciesOpt } from '../../types/models/video/video-file' import { VideoModel } from './video' @@ -225,7 +225,7 @@ function videoFilesModelToFormattedJSON ( function addVideoFilesInAPAcc ( acc: ActivityUrlObject[] | ActivityTagObject[], - video: MVideoWithHost, + video: MVideo, files: MVideoFile[] ) { const trackerUrls = video.getTrackerUrls() -- cgit v1.2.3