+ createByString (account: Account) {
+ return Account.CREATE_BY_STRING(account.name, account.host)
+ }
+
+ isVideoAbuseAccepted (videoAbuse: VideoAbuse) {
+ return videoAbuse.state.id === VideoAbuseState.ACCEPTED
+ }
+
+ isVideoAbuseRejected (videoAbuse: VideoAbuse) {
+ return videoAbuse.state.id === VideoAbuseState.REJECTED
+ }
+
+ getVideoUrl (videoAbuse: VideoAbuse) {
+ return Video.buildClientUrl(videoAbuse.video.uuid)
+ }
+
+ async removeVideoAbuse (videoAbuse: VideoAbuse) {
+ const res = await this.confirmService.confirm(this.i18n('Do you really want to delete this abuse?'), this.i18n('Delete'))
+ if (res === false) return
+
+ this.videoAbuseService.removeVideoAbuse(videoAbuse).subscribe(
+ () => {
+ this.notificationsService.success(
+ this.i18n('Success'),
+ this.i18n('Abuse deleted.')
+ )
+ this.loadData()
+ },
+
+ err => this.notificationsService.error(this.i18n('Error'), err.message)
+ )
+ }
+
+ updateVideoAbuseState (videoAbuse: VideoAbuse, state: VideoAbuseState) {
+ this.videoAbuseService.updateVideoAbuse(videoAbuse, { state })
+ .subscribe(
+ () => this.loadData(),
+
+ err => this.notificationsService.error(this.i18n('Error'), err.message)
+ )
+