X-Git-Url: https://git.immae.eu/?a=blobdiff_plain;f=server%2Fmodels%2Fvideo%2Fvideo-file.ts;h=22cf638046afb6e3fb1ee0bf2e33285cc5484859;hb=d9bf974f5df787bbeaab5b04949ca91a2b3ca2a3;hp=e3fa2f3d255cb3a4f5695a7118904ba3cdd00c86;hpb=5b1a6d45b5d6e50102e1c7c8c845401b76b11b4d;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