Fix hidden delete button for original file

pull/6544/head
Chocobozzz 2024-08-06 13:41:08 +02:00
parent 4373b2d566
commit 4df22f9e47
No known key found for this signature in database
GPG Key ID: 583A612D890159BE
4 changed files with 5 additions and 9 deletions

View File

@ -128,11 +128,7 @@
<li>
<a title="Download this file" i18n-title [href]="getDownloadUrl(video, video.videoSource.fileDownloadUrl)">{{ video.videoSource.inputFilename }}</a>: {{ video.videoSource.size | bytes: 1 }}
<button
*ngIf="canRemoveOneFile(video)" class="border-0 p-0"
i18n-title title="Delete this file"
(click)="removeVideoSourceFile(video)"
>
<button class="border-0 p-0" i18n-title title="Delete this file" (click)="removeVideoSourceFile(video)">
<my-global-icon iconName="delete"></my-global-icon>
</button>
</li>

View File

@ -159,13 +159,13 @@ export class VideoListComponent extends RestTable <Video> implements OnInit {
{
label: $localize`Delete HLS files`,
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'
},
{
label: $localize`Delete Web Video files`,
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'
}
],

View File

@ -265,7 +265,7 @@ export class Video implements VideoServerModel {
getAllFiles(this).length > 1
}
canRemoveFiles (user: AuthUser) {
canRemoveAllHLSOrWebFiles (user: AuthUser) {
return this.isLocal &&
user && user.hasRight(UserRight.MANAGE_VIDEO_FILES) &&
this.state.id !== VideoState.TO_TRANSCODE &&

View File

@ -243,7 +243,7 @@ export class VideoActionsDropdownComponent implements OnChanges {
}
canRemoveVideoFiles () {
return this.video.canRemoveFiles(this.user)
return this.video.canRemoveAllHLSOrWebFiles(this.user)
}
canRunTranscoding () {