diff options
Diffstat (limited to 'server/models/video')
-rw-r--r-- | server/models/video/video-file.ts | 3 | ||||
-rw-r--r-- | server/models/video/video-streaming-playlist.ts | 5 |
2 files changed, 5 insertions, 3 deletions
diff --git a/server/models/video/video-file.ts b/server/models/video/video-file.ts index c20c90c1b..9c4e6d078 100644 --- a/server/models/video/video-file.ts +++ b/server/models/video/video-file.ts | |||
@@ -54,6 +54,7 @@ import { doesExist } from '../shared' | |||
54 | import { parseAggregateResult, throwIfNotValid } from '../utils' | 54 | import { parseAggregateResult, throwIfNotValid } from '../utils' |
55 | import { VideoModel } from './video' | 55 | import { VideoModel } from './video' |
56 | import { VideoStreamingPlaylistModel } from './video-streaming-playlist' | 56 | import { VideoStreamingPlaylistModel } from './video-streaming-playlist' |
57 | import { CONFIG } from '@server/initializers/config' | ||
57 | 58 | ||
58 | export enum ScopeNames { | 59 | export enum ScopeNames { |
59 | WITH_VIDEO = 'WITH_VIDEO', | 60 | WITH_VIDEO = 'WITH_VIDEO', |
@@ -511,7 +512,7 @@ export class VideoFileModel extends Model<Partial<AttributesOnly<VideoFileModel> | |||
511 | // --------------------------------------------------------------------------- | 512 | // --------------------------------------------------------------------------- |
512 | 513 | ||
513 | getObjectStorageUrl (video: MVideo) { | 514 | getObjectStorageUrl (video: MVideo) { |
514 | if (video.hasPrivateStaticPath()) { | 515 | if (video.hasPrivateStaticPath() && CONFIG.OBJECT_STORAGE.PROXY.PROXIFY_PRIVATE_FILES === true) { |
515 | return this.getPrivateObjectStorageUrl(video) | 516 | return this.getPrivateObjectStorageUrl(video) |
516 | } | 517 | } |
517 | 518 | ||
diff --git a/server/models/video/video-streaming-playlist.ts b/server/models/video/video-streaming-playlist.ts index 1318a4dae..0386edf28 100644 --- a/server/models/video/video-streaming-playlist.ts +++ b/server/models/video/video-streaming-playlist.ts | |||
@@ -15,6 +15,7 @@ import { | |||
15 | Table, | 15 | Table, |
16 | UpdatedAt | 16 | UpdatedAt |
17 | } from 'sequelize-typescript' | 17 | } from 'sequelize-typescript' |
18 | import { CONFIG } from '@server/initializers/config' | ||
18 | import { getHLSPrivateFileUrl, getHLSPublicFileUrl } from '@server/lib/object-storage' | 19 | import { getHLSPrivateFileUrl, getHLSPublicFileUrl } from '@server/lib/object-storage' |
19 | import { generateHLSMasterPlaylistFilename, generateHlsSha256SegmentsFilename } from '@server/lib/paths' | 20 | import { generateHLSMasterPlaylistFilename, generateHlsSha256SegmentsFilename } from '@server/lib/paths' |
20 | import { isVideoInPrivateDirectory } from '@server/lib/video-privacy' | 21 | import { isVideoInPrivateDirectory } from '@server/lib/video-privacy' |
@@ -260,7 +261,7 @@ export class VideoStreamingPlaylistModel extends Model<Partial<AttributesOnly<Vi | |||
260 | } | 261 | } |
261 | 262 | ||
262 | private getMasterPlaylistObjectStorageUrl (video: MVideo) { | 263 | private getMasterPlaylistObjectStorageUrl (video: MVideo) { |
263 | if (video.hasPrivateStaticPath()) { | 264 | if (video.hasPrivateStaticPath() && CONFIG.OBJECT_STORAGE.PROXY.PROXIFY_PRIVATE_FILES === true) { |
264 | return getHLSPrivateFileUrl(video, this.playlistFilename) | 265 | return getHLSPrivateFileUrl(video, this.playlistFilename) |
265 | } | 266 | } |
266 | 267 | ||
@@ -282,7 +283,7 @@ export class VideoStreamingPlaylistModel extends Model<Partial<AttributesOnly<Vi | |||
282 | } | 283 | } |
283 | 284 | ||
284 | private getSha256SegmentsObjectStorageUrl (video: MVideo) { | 285 | private getSha256SegmentsObjectStorageUrl (video: MVideo) { |
285 | if (video.hasPrivateStaticPath()) { | 286 | if (video.hasPrivateStaticPath() && CONFIG.OBJECT_STORAGE.PROXY.PROXIFY_PRIVATE_FILES === true) { |
286 | return getHLSPrivateFileUrl(video, this.segmentsSha256Filename) | 287 | return getHLSPrivateFileUrl(video, this.segmentsSha256Filename) |
287 | } | 288 | } |
288 | 289 | ||