From 156c50af3085468a47b8ae73fe8cfcae46b42398 Mon Sep 17 00:00:00 2001 From: Lucas Declercq Date: Sat, 6 Oct 2018 19:17:21 +0200 Subject: Add downloadingEnabled property to video model --- .../video-add-components/video-import-torrent.component.ts | 2 ++ .../+video-edit/video-add-components/video-import-url.component.ts | 2 ++ .../videos/+video-edit/video-add-components/video-upload.component.ts | 2 ++ client/src/app/videos/+video-watch/video-watch.component.html | 2 +- client/src/app/videos/+video-watch/video-watch.component.ts | 4 ++++ 5 files changed, 11 insertions(+), 1 deletion(-) (limited to 'client/src/app/videos') diff --git a/client/src/app/videos/+video-edit/video-add-components/video-import-torrent.component.ts b/client/src/app/videos/+video-edit/video-add-components/video-import-torrent.component.ts index 0f7184ff8..57cf0e395 100644 --- a/client/src/app/videos/+video-edit/video-add-components/video-import-torrent.component.ts +++ b/client/src/app/videos/+video-edit/video-add-components/video-import-torrent.component.ts @@ -77,6 +77,7 @@ export class VideoImportTorrentComponent extends VideoSend implements OnInit, Ca privacy: this.firstStepPrivacyId, waitTranscoding: false, commentsEnabled: true, + downloadingEnabled: true, channelId: this.firstStepChannelId } @@ -91,6 +92,7 @@ export class VideoImportTorrentComponent extends VideoSend implements OnInit, Ca this.video = new VideoEdit(Object.assign(res.video, { commentsEnabled: videoUpdate.commentsEnabled, + downloadingEnabled: videoUpdate.downloadingEnabled, support: null, thumbnailUrl: null, previewUrl: null diff --git a/client/src/app/videos/+video-edit/video-add-components/video-import-url.component.ts b/client/src/app/videos/+video-edit/video-add-components/video-import-url.component.ts index 031e557ed..11db4a7ef 100644 --- a/client/src/app/videos/+video-edit/video-add-components/video-import-url.component.ts +++ b/client/src/app/videos/+video-edit/video-add-components/video-import-url.component.ts @@ -69,6 +69,7 @@ export class VideoImportUrlComponent extends VideoSend implements OnInit, CanCom privacy: this.firstStepPrivacyId, waitTranscoding: false, commentsEnabled: true, + downloadingEnabled: true, channelId: this.firstStepChannelId } @@ -83,6 +84,7 @@ export class VideoImportUrlComponent extends VideoSend implements OnInit, CanCom this.video = new VideoEdit(Object.assign(res.video, { commentsEnabled: videoUpdate.commentsEnabled, + downloadingEnabled: videoUpdate.downloadingEnabled, support: null, thumbnailUrl: null, previewUrl: null diff --git a/client/src/app/videos/+video-edit/video-add-components/video-upload.component.ts b/client/src/app/videos/+video-edit/video-add-components/video-upload.component.ts index 941dc5441..53f72f4e6 100644 --- a/client/src/app/videos/+video-edit/video-add-components/video-upload.component.ts +++ b/client/src/app/videos/+video-edit/video-add-components/video-upload.component.ts @@ -159,6 +159,7 @@ export class VideoUploadComponent extends VideoSend implements OnInit, OnDestroy const nsfw = false const waitTranscoding = true const commentsEnabled = true + const downloadingEnabled = true const channelId = this.firstStepChannelId.toString() const formData = new FormData() @@ -167,6 +168,7 @@ export class VideoUploadComponent extends VideoSend implements OnInit, OnDestroy formData.append('privacy', VideoPrivacy.PRIVATE.toString()) formData.append('nsfw', '' + nsfw) formData.append('commentsEnabled', '' + commentsEnabled) + formData.append('downloadingEnabled', '' + downloadingEnabled) formData.append('waitTranscoding', '' + waitTranscoding) formData.append('channelId', '' + channelId) formData.append('videofile', videofile) diff --git a/client/src/app/videos/+video-watch/video-watch.component.html b/client/src/app/videos/+video-watch/video-watch.component.html index 770785d02..ba04d638f 100644 --- a/client/src/app/videos/+video-watch/video-watch.component.html +++ b/client/src/app/videos/+video-watch/video-watch.component.html @@ -80,7 +80,7 @@
- + Download diff --git a/client/src/app/videos/+video-watch/video-watch.component.ts b/client/src/app/videos/+video-watch/video-watch.component.ts index c5deddf05..7cc831ab1 100644 --- a/client/src/app/videos/+video-watch/video-watch.component.ts +++ b/client/src/app/videos/+video-watch/video-watch.component.ts @@ -313,6 +313,10 @@ export class VideoWatchComponent implements OnInit, OnDestroy { return this.video && this.video.state.id === VideoState.TO_TRANSCODE } + isVideoDownloadable () { + return this.video && this.video.downloadingEnabled + } + isVideoToImport () { return this.video && this.video.state.id === VideoState.TO_IMPORT } -- cgit v1.2.3