X-Git-Url: https://git.immae.eu/?a=blobdiff_plain;f=server%2Fmodels%2Fvideo%2Fvideo-file.ts;h=22cf638046afb6e3fb1ee0bf2e33285cc5484859;hb=49af5ac8c2653cb0ef23479c9d3256c5b724d49d;hp=e3fa2f3d255cb3a4f5695a7118904ba3cdd00c86;hpb=16c016e8b1d5ca46343d3363f9a49e24c5d7c944;p=github%2FChocobozzz%2FPeerTube.git diff --git a/server/models/video/video-file.ts b/server/models/video/video-file.ts index e3fa2f3d2..22cf63804 100644 --- a/server/models/video/video-file.ts +++ b/server/models/video/video-file.ts @@ -402,6 +402,10 @@ export class VideoFileModel extends Model return VideoFileModel.destroy(options) } + hasTorrent () { + return this.infoHash && this.torrentFilename + } + getVideoOrStreamingPlaylist (this: MVideoFileVideo | MVideoFileStreamingPlaylistVideo): MVideo | MStreamingPlaylistVideo { if (this.videoId) return (this as MVideoFileVideo).Video