]> git.immae.eu Git - github/Chocobozzz/PeerTube.git/blobdiff - server/models/video/video-file.ts
Option to disable static files auth check/s3 proxy
[github/Chocobozzz/PeerTube.git] / server / models / video / video-file.ts
index c20c90c1b2b61fafbdcc5bda4d3176e2293573ac..9c4e6d078afbd5d61057194ce95180330e99995c 100644 (file)
@@ -54,6 +54,7 @@ import { doesExist } from '../shared'
 import { parseAggregateResult, throwIfNotValid } from '../utils'
 import { VideoModel } from './video'
 import { VideoStreamingPlaylistModel } from './video-streaming-playlist'
+import { CONFIG } from '@server/initializers/config'
 
 export enum ScopeNames {
   WITH_VIDEO = 'WITH_VIDEO',
@@ -511,7 +512,7 @@ export class VideoFileModel extends Model<Partial<AttributesOnly<VideoFileModel>
   // ---------------------------------------------------------------------------
 
   getObjectStorageUrl (video: MVideo) {
-    if (video.hasPrivateStaticPath()) {
+    if (video.hasPrivateStaticPath() && CONFIG.OBJECT_STORAGE.PROXY.PROXIFY_PRIVATE_FILES === true) {
       return this.getPrivateObjectStorageUrl(video)
     }