|
@@ -405,23 +405,20 @@ class NCMedia: UIViewController, NCEmptyDataSetDelegate, NCSelectDelegate {
|
|
|
if self.view?.window == nil { return }
|
|
|
|
|
|
if let userInfo = notification.userInfo as NSDictionary? {
|
|
|
- if let ocId = userInfo["ocId"] as? String, let metadata = NCManageDatabase.sharedInstance.getMetadataFromOcId(ocId) {
|
|
|
+ if let ocId = userInfo["ocId"] as? String {
|
|
|
+
|
|
|
+ let indexes = self.metadatas.indices.filter { self.metadatas[$0].ocId == ocId }
|
|
|
+ let metadatas = self.metadatas.filter { $0.ocId != ocId }
|
|
|
+ self.metadatas = metadatas
|
|
|
|
|
|
- if metadata.account == appDelegate.account {
|
|
|
-
|
|
|
- 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()
|
|
|
+ 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()
|
|
|
}
|
|
|
}
|
|
|
}
|