+
+ private async removeComments (comments: VideoCommentAdmin[]) {
+ const commentArgs = comments.map(c => ({ videoId: c.video.id, commentId: c.id }))
+
+ this.videoCommentService.deleteVideoComments(commentArgs).subscribe(
+ () => {
+ this.notifier.success($localize`${commentArgs.length} comments deleted.`)
+ this.loadData()
+ },
+
+ err => this.notifier.error(err.message),
+
+ () => this.selectedComments = []
+ )
+ }
+
+ private deleteComment (comment: VideoCommentAdmin) {
+ this.videoCommentService.deleteVideoComment(comment.video.id, comment.id)
+ .subscribe(
+ () => this.loadData(),
+
+ err => this.notifier.error(err.message)
+ )
+ }
+
+ private async deleteUserComments (comment: VideoCommentAdmin) {
+ const message = $localize`Do you really want to delete all comments of ${comment.by}?`
+ const res = await this.confirmService.confirm(message, $localize`Delete`)
+ if (res === false) return
+
+ const options = {
+ accountName: comment.by,
+ scope: 'instance' as 'instance'
+ }
+
+ this.bulkService.removeCommentsOf(options)
+ .subscribe(
+ () => {
+ this.notifier.success($localize`Comments of ${options.accountName} will be deleted in a few minutes`)
+ },
+
+ err => this.notifier.error(err.message)
+ )
+ }