diff options
Diffstat (limited to 'client/src/app/shared/video')
-rw-r--r-- | client/src/app/shared/video/video-actions-dropdown.component.ts | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/client/src/app/shared/video/video-actions-dropdown.component.ts b/client/src/app/shared/video/video-actions-dropdown.component.ts index b2d77a9e6..c1da0eba6 100644 --- a/client/src/app/shared/video/video-actions-dropdown.component.ts +++ b/client/src/app/shared/video/video-actions-dropdown.component.ts | |||
@@ -1,4 +1,4 @@ | |||
1 | import { AfterContentInit, AfterViewInit, Component, EventEmitter, Input, OnChanges, OnInit, Output, ViewChild } from '@angular/core' | 1 | import { AfterViewInit, Component, EventEmitter, Input, OnChanges, Output, ViewChild } from '@angular/core' |
2 | import { I18n } from '@ngx-translate/i18n-polyfill' | 2 | import { I18n } from '@ngx-translate/i18n-polyfill' |
3 | import { DropdownAction, DropdownButtonSize, DropdownDirection } from '@app/shared/buttons/action-dropdown.component' | 3 | import { DropdownAction, DropdownButtonSize, DropdownDirection } from '@app/shared/buttons/action-dropdown.component' |
4 | import { AuthService, ConfirmService, Notifier, ServerService } from '@app/core' | 4 | import { AuthService, ConfirmService, Notifier, ServerService } from '@app/core' |
@@ -133,6 +133,10 @@ export class VideoActionsDropdownComponent implements AfterViewInit, OnChanges { | |||
133 | return this.video.isUnblacklistableBy(this.user) | 133 | return this.video.isUnblacklistableBy(this.user) |
134 | } | 134 | } |
135 | 135 | ||
136 | isVideoDownloadable () { | ||
137 | return this.video && this.video instanceof VideoDetails && this.video.downloadEnabled | ||
138 | } | ||
139 | |||
136 | /* Action handlers */ | 140 | /* Action handlers */ |
137 | 141 | ||
138 | async unblacklistVideo () { | 142 | async unblacklistVideo () { |
@@ -202,7 +206,7 @@ export class VideoActionsDropdownComponent implements AfterViewInit, OnChanges { | |||
202 | { | 206 | { |
203 | label: this.i18n('Download'), | 207 | label: this.i18n('Download'), |
204 | handler: () => this.showDownloadModal(), | 208 | handler: () => this.showDownloadModal(), |
205 | isDisplayed: () => this.displayOptions.download, | 209 | isDisplayed: () => this.displayOptions.download && this.isVideoDownloadable(), |
206 | iconName: 'download' | 210 | iconName: 'download' |
207 | }, | 211 | }, |
208 | { | 212 | { |