|
@@ -373,7 +373,7 @@ class NCMedia: UIViewController, DropdownMenuDelegate, DZNEmptyDataSetSource, DZ
|
|
|
|
|
|
if let userInfo = notification.userInfo as NSDictionary? {
|
|
|
if let metadata = userInfo["metadata"] as? tableMetadata, let errorCode = userInfo["errorCode"] as? Int {
|
|
|
- if metadata.account == appDelegate.account {
|
|
|
+ if metadata.account == appDelegate.account && errorCode == 0 {
|
|
|
|
|
|
let indexes = self.metadatas.indices.filter { self.metadatas[$0].ocId == metadata.ocId }
|
|
|
let metadatas = self.metadatas.filter { $0.ocId != metadata.ocId }
|
|
@@ -387,11 +387,6 @@ class NCMedia: UIViewController, DropdownMenuDelegate, DZNEmptyDataSetSource, DZ
|
|
|
}
|
|
|
|
|
|
self.updateMediaControlVisibility()
|
|
|
-
|
|
|
- if errorCode == 0 && (metadata.typeFile == k_metadataTypeFile_image || metadata.typeFile == k_metadataTypeFile_video || metadata.typeFile == k_metadataTypeFile_audio) {
|
|
|
- let userInfo: [String : Any] = ["metadata": metadata, "type": "delete"]
|
|
|
- NotificationCenter.default.postOnMainThread(name: k_notificationCenter_synchronizationMedia, userInfo: userInfo)
|
|
|
- }
|
|
|
}
|
|
|
}
|
|
|
}
|
|
@@ -401,15 +396,9 @@ class NCMedia: UIViewController, DropdownMenuDelegate, DZNEmptyDataSetSource, DZ
|
|
|
if self.view?.window == nil { return }
|
|
|
|
|
|
if let userInfo = notification.userInfo as NSDictionary? {
|
|
|
- if let metadata = userInfo["metadata"] as? tableMetadata, let metadataNew = userInfo["metadataNew"] as? tableMetadata, let errorCode = userInfo["errorCode"] as? Int {
|
|
|
- if metadata.account == appDelegate.account {
|
|
|
- self.reloadDataSourceWithCompletion() {
|
|
|
-
|
|
|
- if errorCode == 0 && (metadata.typeFile == k_metadataTypeFile_image || metadata.typeFile == k_metadataTypeFile_video || metadata.typeFile == k_metadataTypeFile_audio) {
|
|
|
- let userInfo: [String : Any] = ["metadata": metadata, "metadataNew": metadataNew, "type": "move"]
|
|
|
- NotificationCenter.default.postOnMainThread(name: k_notificationCenter_synchronizationMedia, userInfo: userInfo)
|
|
|
- }
|
|
|
- }
|
|
|
+ if let metadata = userInfo["metadata"] as? tableMetadata, let errorCode = userInfo["errorCode"] as? Int {
|
|
|
+ if metadata.account == appDelegate.account && errorCode == 0 {
|
|
|
+ self.reloadDataSource()
|
|
|
}
|
|
|
}
|
|
|
}
|
|
@@ -420,14 +409,8 @@ class NCMedia: UIViewController, DropdownMenuDelegate, DZNEmptyDataSetSource, DZ
|
|
|
|
|
|
if let userInfo = notification.userInfo as NSDictionary? {
|
|
|
if let metadata = userInfo["metadata"] as? tableMetadata, let errorCode = userInfo["errorCode"] as? Int {
|
|
|
- if metadata.account == appDelegate.account {
|
|
|
- self.reloadDataSourceWithCompletion() {
|
|
|
-
|
|
|
- if errorCode == 0 && (metadata.typeFile == k_metadataTypeFile_image || metadata.typeFile == k_metadataTypeFile_video || metadata.typeFile == k_metadataTypeFile_audio) {
|
|
|
- let userInfo: [String : Any] = ["metadata": metadata, "type": "rename"]
|
|
|
- NotificationCenter.default.postOnMainThread(name: k_notificationCenter_synchronizationMedia, userInfo: userInfo)
|
|
|
- }
|
|
|
- }
|
|
|
+ if metadata.account == appDelegate.account && errorCode == 0 {
|
|
|
+ self.reloadDataSource()
|
|
|
}
|
|
|
}
|
|
|
}
|