This commit is contained in:
Wicklow 2023-11-30 15:30:41 +01:00 committed by GitHub
commit 6fa22a3b96
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 14 additions and 6 deletions

View File

@ -48,7 +48,7 @@ export class MyVideosComponent implements OnInit, DisableForReuseHook {
} }
videoDropdownDisplayOptions: VideoActionsDisplayType = { videoDropdownDisplayOptions: VideoActionsDisplayType = {
playlist: false, playlist: false,
download: false, download: true,
update: false, update: false,
blacklist: false, blacklist: false,
delete: true, delete: true,

View File

@ -232,7 +232,7 @@ export class Video implements VideoServerModel {
this.isUpdatableBy(user) this.isUpdatableBy(user)
} }
canSeeStats (user: AuthUser) { isAccessibleBy (user: AuthUser) {
return user && this.isLocal === true && (this.account.name === user.username || user.hasRight(UserRight.SEE_ALL_VIDEOS)) return user && this.isLocal === true && (this.account.name === user.username || user.hasRight(UserRight.SEE_ALL_VIDEOS))
} }

View File

@ -16,6 +16,7 @@ import {
import { LiveStreamInformationComponent } from '../shared-video-live' import { LiveStreamInformationComponent } from '../shared-video-live'
import { VideoAddToPlaylistComponent } from '../shared-video-playlist' import { VideoAddToPlaylistComponent } from '../shared-video-playlist'
import { VideoDownloadComponent } from './video-download.component' import { VideoDownloadComponent } from './video-download.component'
import { of } from 'rxjs'
export type VideoActionsDisplayType = { export type VideoActionsDisplayType = {
playlist?: boolean playlist?: boolean
@ -128,7 +129,13 @@ export class VideoActionsDropdownComponent implements OnChanges {
showDownloadModal () { showDownloadModal () {
this.modalOpened.emit() this.modalOpened.emit()
this.videoDownloadModal.show(this.video as VideoDetails, this.videoCaptions) const obs = this.video instanceof VideoDetails
? of(this.video)
: this.videoService.getVideo({ videoId: this.video.uuid })
obs.subscribe((videoDetails: VideoDetails) => {
this.videoDownloadModal.show(videoDetails, this.videoCaptions)
})
} }
showReportModal () { showReportModal () {
@ -160,7 +167,7 @@ export class VideoActionsDropdownComponent implements OnChanges {
} }
isVideoStatsAvailable () { isVideoStatsAvailable () {
return this.video.canSeeStats(this.user) return this.video.isAccessibleBy(this.user)
} }
isVideoRemovable () { isVideoRemovable () {
@ -180,10 +187,11 @@ export class VideoActionsDropdownComponent implements OnChanges {
} }
isVideoDownloadable () { isVideoDownloadable () {
return this.video && return (this.video &&
this.video.isLive !== true && this.video.isLive !== true &&
this.video instanceof VideoDetails && this.video instanceof VideoDetails &&
this.video.downloadEnabled this.video.downloadEnabled) ||
this.video.isAccessibleBy(this.user)
} }
canVideoBeDuplicated () { canVideoBeDuplicated () {