|
@@ -159,13 +159,13 @@ 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 errorCode != 0 { return }
|
|
|
-
|
|
|
- self.selectocId.removeAll { $0 == metadata.ocId }
|
|
|
- self.reloadDataSource(loadNetworkDatasource: false) {
|
|
|
-
|
|
|
- let userInfo: [String : Any] = ["metadata": metadata, "type": "delete"]
|
|
|
- NotificationCenter.default.post(name: Notification.Name.init(rawValue: k_notificationCenter_synchronizationMedia), object: nil, userInfo: userInfo)
|
|
|
+ if errorCode == 0 && (metadata.typeFile == k_metadataTypeFile_image || metadata.typeFile == k_metadataTypeFile_video || metadata.typeFile == k_metadataTypeFile_audio) {
|
|
|
+
|
|
|
+ self.reloadDataSource(loadNetworkDatasource: false) {
|
|
|
+
|
|
|
+ let userInfo: [String : Any] = ["metadata": metadata, "type": "delete"]
|
|
|
+ NotificationCenter.default.post(name: Notification.Name.init(rawValue: k_notificationCenter_synchronizationMedia), object: nil, userInfo: userInfo)
|
|
|
+ }
|
|
|
}
|
|
|
}
|
|
|
}
|
|
@@ -175,8 +175,14 @@ class NCMedia: UIViewController, DropdownMenuDelegate, DZNEmptyDataSetSource, DZ
|
|
|
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 errorCode != 0 { return }
|
|
|
-
|
|
|
+ if errorCode == 0 && (metadata.typeFile == k_metadataTypeFile_image || metadata.typeFile == k_metadataTypeFile_video || metadata.typeFile == k_metadataTypeFile_audio) {
|
|
|
+
|
|
|
+ self.reloadDataSource(loadNetworkDatasource: false) {
|
|
|
+
|
|
|
+ let userInfo: [String : Any] = ["metadata": metadata, "metadataNew": metadataNew, "type": "move"]
|
|
|
+ NotificationCenter.default.post(name: Notification.Name.init(rawValue: k_notificationCenter_synchronizationMedia), object: nil, userInfo: userInfo)
|
|
|
+ }
|
|
|
+ }
|
|
|
}
|
|
|
}
|
|
|
}
|