diff options
Diffstat (limited to 'server/models/video')
-rw-r--r-- | server/models/video/thumbnail.ts | 4 | ||||
-rw-r--r-- | server/models/video/video-caption.ts | 4 | ||||
-rw-r--r-- | server/models/video/video-file.ts | 4 | ||||
-rw-r--r-- | server/models/video/video-format-utils.ts | 6 |
4 files changed, 9 insertions, 9 deletions
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 { | |||
16 | UpdatedAt | 16 | UpdatedAt |
17 | } from 'sequelize-typescript' | 17 | } from 'sequelize-typescript' |
18 | import { afterCommitIfTransaction } from '@server/helpers/database-utils' | 18 | import { afterCommitIfTransaction } from '@server/helpers/database-utils' |
19 | import { MThumbnail, MThumbnailVideo, MVideoWithHost } from '@server/types/models' | 19 | import { MThumbnail, MThumbnailVideo, MVideo } from '@server/types/models' |
20 | import { ThumbnailType } from '../../../shared/models/videos/thumbnail.type' | 20 | import { ThumbnailType } from '../../../shared/models/videos/thumbnail.type' |
21 | import { logger } from '../../helpers/logger' | 21 | import { logger } from '../../helpers/logger' |
22 | import { CONFIG } from '../../initializers/config' | 22 | import { CONFIG } from '../../initializers/config' |
@@ -163,7 +163,7 @@ export class ThumbnailModel extends Model { | |||
163 | return join(directory, filename) | 163 | return join(directory, filename) |
164 | } | 164 | } |
165 | 165 | ||
166 | getFileUrl (video: MVideoWithHost) { | 166 | getFileUrl (video: MVideo) { |
167 | const staticPath = ThumbnailModel.types[this.type].staticPath + this.filename | 167 | const staticPath = ThumbnailModel.types[this.type].staticPath + this.filename |
168 | 168 | ||
169 | if (video.isOwned()) return WEBSERVER.URL + staticPath | 169 | 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 { | |||
16 | UpdatedAt | 16 | UpdatedAt |
17 | } from 'sequelize-typescript' | 17 | } from 'sequelize-typescript' |
18 | import { v4 as uuidv4 } from 'uuid' | 18 | import { v4 as uuidv4 } from 'uuid' |
19 | import { MVideoCaption, MVideoCaptionFormattable, MVideoCaptionVideo, MVideoWithHost } from '@server/types/models' | 19 | import { MVideo, MVideoCaption, MVideoCaptionFormattable, MVideoCaptionVideo } from '@server/types/models' |
20 | import { VideoCaption } from '../../../shared/models/videos/caption/video-caption.model' | 20 | import { VideoCaption } from '../../../shared/models/videos/caption/video-caption.model' |
21 | import { isVideoCaptionLanguageValid } from '../../helpers/custom-validators/video-captions' | 21 | import { isVideoCaptionLanguageValid } from '../../helpers/custom-validators/video-captions' |
22 | import { logger } from '../../helpers/logger' | 22 | import { logger } from '../../helpers/logger' |
@@ -203,7 +203,7 @@ export class VideoCaptionModel extends Model { | |||
203 | return remove(CONFIG.STORAGE.CAPTIONS_DIR + this.filename) | 203 | return remove(CONFIG.STORAGE.CAPTIONS_DIR + this.filename) |
204 | } | 204 | } |
205 | 205 | ||
206 | getFileUrl (video: MVideoWithHost) { | 206 | getFileUrl (video: MVideo) { |
207 | if (!this.Video) this.Video = video as VideoModel | 207 | if (!this.Video) this.Video = video as VideoModel |
208 | 208 | ||
209 | if (video.isOwned()) return WEBSERVER.URL + this.getCaptionStaticPath() | 209 | 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 { | |||
423 | return !!this.videoStreamingPlaylistId | 423 | return !!this.videoStreamingPlaylistId |
424 | } | 424 | } |
425 | 425 | ||
426 | getFileUrl (video: MVideoWithHost) { | 426 | getFileUrl (video: MVideo) { |
427 | if (!this.Video) this.Video = video as VideoModel | 427 | if (!this.Video) this.Video = video as VideoModel |
428 | 428 | ||
429 | if (video.isOwned()) return WEBSERVER.URL + this.getFileStaticPath(video) | 429 | if (video.isOwned()) return WEBSERVER.URL + this.getFileStaticPath(video) |
@@ -449,7 +449,7 @@ export class VideoFileModel extends Model { | |||
449 | return buildRemoteVideoBaseUrl(video, path) | 449 | return buildRemoteVideoBaseUrl(video, path) |
450 | } | 450 | } |
451 | 451 | ||
452 | getRemoteTorrentUrl (video: MVideoWithHost) { | 452 | getRemoteTorrentUrl (video: MVideo) { |
453 | if (video.isOwned()) throw new Error(`Video ${video.url} is not a remote video`) | 453 | if (video.isOwned()) throw new Error(`Video ${video.url} is not a remote video`) |
454 | 454 | ||
455 | return this.torrentUrl | 455 | 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 { | |||
14 | } from '../../lib/activitypub/url' | 14 | } from '../../lib/activitypub/url' |
15 | import { | 15 | import { |
16 | MStreamingPlaylistRedundanciesOpt, | 16 | MStreamingPlaylistRedundanciesOpt, |
17 | MVideo, | ||
17 | MVideoAP, | 18 | MVideoAP, |
18 | MVideoFile, | 19 | MVideoFile, |
19 | MVideoFormattable, | 20 | MVideoFormattable, |
20 | MVideoFormattableDetails, | 21 | MVideoFormattableDetails |
21 | MVideoWithHost | ||
22 | } from '../../types/models' | 22 | } from '../../types/models' |
23 | import { MVideoFileRedundanciesOpt } from '../../types/models/video/video-file' | 23 | import { MVideoFileRedundanciesOpt } from '../../types/models/video/video-file' |
24 | import { VideoModel } from './video' | 24 | import { VideoModel } from './video' |
@@ -225,7 +225,7 @@ function videoFilesModelToFormattedJSON ( | |||
225 | 225 | ||
226 | function addVideoFilesInAPAcc ( | 226 | function addVideoFilesInAPAcc ( |
227 | acc: ActivityUrlObject[] | ActivityTagObject[], | 227 | acc: ActivityUrlObject[] | ActivityTagObject[], |
228 | video: MVideoWithHost, | 228 | video: MVideo, |
229 | files: MVideoFile[] | 229 | files: MVideoFile[] |
230 | ) { | 230 | ) { |
231 | const trackerUrls = video.getTrackerUrls() | 231 | const trackerUrls = video.getTrackerUrls() |