From 2414e1602142518165166373faa35a0f99520d88 Mon Sep 17 00:00:00 2001 From: Isaac Grynsztein Date: Tue, 7 Apr 2020 01:52:22 -0400 Subject: [PATCH] videos now deleted by UID ui-side --- src/app/file-card/file-card.component.ts | 3 ++- src/app/main/main.component.html | 4 ++-- src/app/posts.services.ts | 6 +++--- 3 files changed, 7 insertions(+), 6 deletions(-) diff --git a/src/app/file-card/file-card.component.ts b/src/app/file-card/file-card.component.ts index 16f33ed..7c3548b 100644 --- a/src/app/file-card/file-card.component.ts +++ b/src/app/file-card/file-card.component.ts @@ -18,6 +18,7 @@ export class FileCardComponent implements OnInit { @Input() title: string; @Input() length: string; @Input() name: string; + @Input() uid: string; @Input() thumbnailURL: string; @Input() isAudio = true; @Output() removeFile: EventEmitter = new EventEmitter(); @@ -47,7 +48,7 @@ export class FileCardComponent implements OnInit { deleteFile(blacklistMode = false) { if (!this.isPlaylist) { - this.postsService.deleteFile(this.name, this.isAudio, blacklistMode).subscribe(result => { + this.postsService.deleteFile(this.uid, this.isAudio, blacklistMode).subscribe(result => { if (result === true) { this.openSnackBar('Delete success!', 'OK.'); this.removeFile.emit(this.name); diff --git a/src/app/main/main.component.html b/src/app/main/main.component.html index d7d981f..84fe86e 100644 --- a/src/app/main/main.component.html +++ b/src/app/main/main.component.html @@ -204,7 +204,7 @@
- @@ -245,7 +245,7 @@
- diff --git a/src/app/posts.services.ts b/src/app/posts.services.ts index 752cc9b..66afcfd 100644 --- a/src/app/posts.services.ts +++ b/src/app/posts.services.ts @@ -102,11 +102,11 @@ export class PostsService { return this.http.post(this.path + 'setConfig', {new_config_file: config}); } - deleteFile(name: string, isAudio: boolean, blacklistMode = false) { + deleteFile(uid: string, isAudio: boolean, blacklistMode = false) { if (isAudio) { - return this.http.post(this.path + 'deleteMp3', {name: name, blacklistMode: blacklistMode}); + return this.http.post(this.path + 'deleteMp3', {uid: uid, blacklistMode: blacklistMode}); } else { - return this.http.post(this.path + 'deleteMp4', {name: name, blacklistMode: blacklistMode}); + return this.http.post(this.path + 'deleteMp4', {uid: uid, blacklistMode: blacklistMode}); } }