]> git.immae.eu Git - github/Chocobozzz/PeerTube.git/blobdiff - server/models/video/video-file.ts
Optimize rate endpoint
[github/Chocobozzz/PeerTube.git] / server / models / video / video-file.ts
index 57807cbfd21aadcd9acc1c5935bd72cc5cd16105..4df2c20bc4a3af908175cf886bcbf533147f6d2c 100644 (file)
@@ -423,14 +423,12 @@ 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)
-    if (this.fileUrl) return this.fileUrl
 
-    // Fallback if we don't have a file URL
-    return buildRemoteVideoBaseUrl(video, this.getFileStaticPath(video))
+    return this.fileUrl
   }
 
   getFileStaticPath (video: MVideo) {
@@ -451,13 +449,10 @@ 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`)
 
-    if (this.torrentUrl) return this.torrentUrl
-
-    // Fallback if we don't have a torrent URL
-    return buildRemoteVideoBaseUrl(video, this.getTorrentStaticPath())
+    return this.torrentUrl
   }
 
   // We proxify torrent requests so use a local URL