aboutsummaryrefslogtreecommitdiffhomepage
path: root/client/src
diff options
context:
space:
mode:
Diffstat (limited to 'client/src')
-rw-r--r--client/src/app/shared/video/modals/video-download.component.ts12
1 files changed, 9 insertions, 3 deletions
diff --git a/client/src/app/shared/video/modals/video-download.component.ts b/client/src/app/shared/video/modals/video-download.component.ts
index 0e9e44de7..5849ee458 100644
--- a/client/src/app/shared/video/modals/video-download.component.ts
+++ b/client/src/app/shared/video/modals/video-download.component.ts
@@ -2,7 +2,8 @@ import { Component, ElementRef, ViewChild } from '@angular/core'
2import { VideoDetails } from '../../../shared/video/video-details.model' 2import { VideoDetails } from '../../../shared/video/video-details.model'
3import { NgbActiveModal, NgbModal } from '@ng-bootstrap/ng-bootstrap' 3import { NgbActiveModal, NgbModal } from '@ng-bootstrap/ng-bootstrap'
4import { I18n } from '@ngx-translate/i18n-polyfill' 4import { I18n } from '@ngx-translate/i18n-polyfill'
5import { Notifier } from '@app/core' 5import { AuthService, Notifier } from '@app/core'
6import { VideoPrivacy } from '@shared/models'
6 7
7@Component({ 8@Component({
8 selector: 'my-video-download', 9 selector: 'my-video-download',
@@ -21,6 +22,7 @@ export class VideoDownloadComponent {
21 constructor ( 22 constructor (
22 private notifier: Notifier, 23 private notifier: Notifier,
23 private modalService: NgbModal, 24 private modalService: NgbModal,
25 private auth: AuthService,
24 private i18n: I18n 26 private i18n: I18n
25 ) { } 27 ) { }
26 28
@@ -57,12 +59,16 @@ export class VideoDownloadComponent {
57 return 59 return
58 } 60 }
59 61
62 const suffix = this.video.privacy.id === VideoPrivacy.PRIVATE
63 ? '?access_token=' + this.auth.getAccessToken()
64 : ''
65
60 switch (this.downloadType) { 66 switch (this.downloadType) {
61 case 'direct': 67 case 'direct':
62 return file.fileDownloadUrl 68 return file.fileDownloadUrl + suffix
63 69
64 case 'torrent': 70 case 'torrent':
65 return file.torrentDownloadUrl 71 return file.torrentDownloadUrl + suffix
66 } 72 }
67 } 73 }
68 74