Reload my videos after delete
authorChocobozzz <me@florianbigard.com>
Fri, 25 May 2018 06:38:59 +0000 (08:38 +0200)
committerChocobozzz <me@florianbigard.com>
Fri, 25 May 2018 06:38:59 +0000 (08:38 +0200)
client/src/app/+my-account/my-account-videos/my-account-videos.component.ts
server/models/video/video.ts

index d8c919feefb7809058400c68d1fd75e8e1b4a17f..6ab6c2aa56a2eab0db31655567b7b0e22ef6cfcd 100644 (file)
@@ -88,7 +88,8 @@ export class MyAccountVideosComponent extends AbstractVideoList implements OnIni
       .subscribe(
         res => {
           this.notificationsService.success('Success', `${toDeleteVideosIds.length} videos deleted.`)
-          this.buildVideoPages()
+          this.abortSelectionMode()
+          this.reloadVideos()
         },
 
         err => this.notificationsService.error('Error', err.message)
@@ -103,8 +104,7 @@ export class MyAccountVideosComponent extends AbstractVideoList implements OnIni
       .subscribe(
         status => {
           this.notificationsService.success('Success', `Video ${video.name} deleted.`)
-          this.spliceVideosById(video.id)
-          this.buildVideoPages()
+          this.reloadVideos()
         },
 
         error => this.notificationsService.error('Error', error.message)
index 967a899f50ad8239f2e23f21ef2300b354163372..012a758eeaa63df5637e40ede7e40f8493b118f5 100644 (file)
@@ -5,7 +5,6 @@ import * as parseTorrent from 'parse-torrent'
 import { join } from 'path'
 import * as Sequelize from 'sequelize'
 import {
-  AfterDestroy,
   AllowNull,
   BeforeDestroy,
   BelongsTo,
@@ -32,7 +31,11 @@ import { Video, VideoDetails, VideoFile } from '../../../shared/models/videos'
 import { VideoFilter } from '../../../shared/models/videos/video-query.type'
 import { activityPubCollection } from '../../helpers/activitypub'
 import {
-  createTorrentPromise, peertubeTruncate, renamePromise, statPromise, unlinkPromise,
+  createTorrentPromise,
+  peertubeTruncate,
+  renamePromise,
+  statPromise,
+  unlinkPromise,
   writeFilePromise
 } from '../../helpers/core-utils'
 import { isActivityPubUrlValid } from '../../helpers/custom-validators/activitypub/misc'