|
@@ -422,7 +422,19 @@ class NCMedia: UIViewController, DZNEmptyDataSetSource, DZNEmptyDataSetDelegate,
|
|
|
if let userInfo = notification.userInfo as NSDictionary? {
|
|
|
if let metadata = userInfo["metadata"] as? tableMetadata {
|
|
|
if metadata.account == appDelegate.account {
|
|
|
- self.reloadDataSource()
|
|
|
+
|
|
|
+ let indexes = self.metadatas.indices.filter { self.metadatas[$0].ocId == metadata.ocId }
|
|
|
+ let metadatas = self.metadatas.filter { $0.ocId != metadata.ocId }
|
|
|
+ self.metadatas = metadatas
|
|
|
+
|
|
|
+ if self.metadatas.count == 0 {
|
|
|
+ collectionView?.reloadData()
|
|
|
+ } else if let row = indexes.first {
|
|
|
+ let indexPath = IndexPath(row: row, section: 0)
|
|
|
+ collectionView?.deleteItems(at: [indexPath])
|
|
|
+ }
|
|
|
+
|
|
|
+ self.updateMediaControlVisibility()
|
|
|
}
|
|
|
}
|
|
|
}
|