mirror of https://github.com/Chocobozzz/PeerTube
Fix hidden delete button for original file
parent
4373b2d566
commit
4df22f9e47
|
@ -128,11 +128,7 @@
|
||||||
<li>
|
<li>
|
||||||
<a title="Download this file" i18n-title [href]="getDownloadUrl(video, video.videoSource.fileDownloadUrl)">{{ video.videoSource.inputFilename }}</a>: {{ video.videoSource.size | bytes: 1 }}
|
<a title="Download this file" i18n-title [href]="getDownloadUrl(video, video.videoSource.fileDownloadUrl)">{{ video.videoSource.inputFilename }}</a>: {{ video.videoSource.size | bytes: 1 }}
|
||||||
|
|
||||||
<button
|
<button class="border-0 p-0" i18n-title title="Delete this file" (click)="removeVideoSourceFile(video)">
|
||||||
*ngIf="canRemoveOneFile(video)" class="border-0 p-0"
|
|
||||||
i18n-title title="Delete this file"
|
|
||||||
(click)="removeVideoSourceFile(video)"
|
|
||||||
>
|
|
||||||
<my-global-icon iconName="delete"></my-global-icon>
|
<my-global-icon iconName="delete"></my-global-icon>
|
||||||
</button>
|
</button>
|
||||||
</li>
|
</li>
|
||||||
|
|
|
@ -159,13 +159,13 @@ export class VideoListComponent extends RestTable <Video> implements OnInit {
|
||||||
{
|
{
|
||||||
label: $localize`Delete HLS files`,
|
label: $localize`Delete HLS files`,
|
||||||
handler: videos => this.removeVideoFiles(videos, 'hls'),
|
handler: videos => this.removeVideoFiles(videos, 'hls'),
|
||||||
isDisplayed: videos => videos.every(v => v.canRemoveFiles(this.authUser)),
|
isDisplayed: videos => videos.every(v => v.canRemoveAllHLSOrWebFiles(this.authUser)),
|
||||||
iconName: 'delete'
|
iconName: 'delete'
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
label: $localize`Delete Web Video files`,
|
label: $localize`Delete Web Video files`,
|
||||||
handler: videos => this.removeVideoFiles(videos, 'web-videos'),
|
handler: videos => this.removeVideoFiles(videos, 'web-videos'),
|
||||||
isDisplayed: videos => videos.every(v => v.canRemoveFiles(this.authUser)),
|
isDisplayed: videos => videos.every(v => v.canRemoveAllHLSOrWebFiles(this.authUser)),
|
||||||
iconName: 'delete'
|
iconName: 'delete'
|
||||||
}
|
}
|
||||||
],
|
],
|
||||||
|
|
|
@ -265,7 +265,7 @@ export class Video implements VideoServerModel {
|
||||||
getAllFiles(this).length > 1
|
getAllFiles(this).length > 1
|
||||||
}
|
}
|
||||||
|
|
||||||
canRemoveFiles (user: AuthUser) {
|
canRemoveAllHLSOrWebFiles (user: AuthUser) {
|
||||||
return this.isLocal &&
|
return this.isLocal &&
|
||||||
user && user.hasRight(UserRight.MANAGE_VIDEO_FILES) &&
|
user && user.hasRight(UserRight.MANAGE_VIDEO_FILES) &&
|
||||||
this.state.id !== VideoState.TO_TRANSCODE &&
|
this.state.id !== VideoState.TO_TRANSCODE &&
|
||||||
|
|
|
@ -243,7 +243,7 @@ export class VideoActionsDropdownComponent implements OnChanges {
|
||||||
}
|
}
|
||||||
|
|
||||||
canRemoveVideoFiles () {
|
canRemoveVideoFiles () {
|
||||||
return this.video.canRemoveFiles(this.user)
|
return this.video.canRemoveAllHLSOrWebFiles(this.user)
|
||||||
}
|
}
|
||||||
|
|
||||||
canRunTranscoding () {
|
canRunTranscoding () {
|
||||||
|
|
Loading…
Reference in New Issue