aboutsummaryrefslogtreecommitdiffhomepage
path: root/server/models/video/video-file.ts
diff options
context:
space:
mode:
authorChocobozzz <me@florianbigard.com>2021-02-18 10:15:11 +0100
committerChocobozzz <chocobozzz@cpy.re>2021-02-18 13:38:09 +0100
commitd9a2a03196275065c28f4a0b7d4d7bc9992d77a1 (patch)
tree14579db95cd07506bf3d8e5c0af3ef1630e8700c /server/models/video/video-file.ts
parent2451916e45420fedf556913ce121f3964c4b57d6 (diff)
downloadPeerTube-d9a2a03196275065c28f4a0b7d4d7bc9992d77a1.tar.gz
PeerTube-d9a2a03196275065c28f4a0b7d4d7bc9992d77a1.tar.zst
PeerTube-d9a2a03196275065c28f4a0b7d4d7bc9992d77a1.zip
Don't guess remote tracker URL
Diffstat (limited to 'server/models/video/video-file.ts')
-rw-r--r--server/models/video/video-file.ts9
1 files changed, 2 insertions, 7 deletions
diff --git a/server/models/video/video-file.ts b/server/models/video/video-file.ts
index 57807cbfd..5a3706259 100644
--- a/server/models/video/video-file.ts
+++ b/server/models/video/video-file.ts
@@ -427,10 +427,8 @@ export class VideoFileModel extends Model {
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)
430 if (this.fileUrl) return this.fileUrl
431 430
432 // Fallback if we don't have a file URL 431 return this.fileUrl
433 return buildRemoteVideoBaseUrl(video, this.getFileStaticPath(video))
434 } 432 }
435 433
436 getFileStaticPath (video: MVideo) { 434 getFileStaticPath (video: MVideo) {
@@ -454,10 +452,7 @@ export class VideoFileModel extends Model {
454 getRemoteTorrentUrl (video: MVideoWithHost) { 452 getRemoteTorrentUrl (video: MVideoWithHost) {
455 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`)
456 454
457 if (this.torrentUrl) return this.torrentUrl 455 return this.torrentUrl
458
459 // Fallback if we don't have a torrent URL
460 return buildRemoteVideoBaseUrl(video, this.getTorrentStaticPath())
461 } 456 }
462 457
463 // We proxify torrent requests so use a local URL 458 // We proxify torrent requests so use a local URL