marinofaggiana 4 years ago
parent
commit
b33ada8439

+ 1 - 0
iOSClient/CCGlobal.h

@@ -321,6 +321,7 @@
 #define k_notificationCenter_reloadDataNCShare          @"reloadDataNCShare"
 #define k_notificationCenter_reloadDataSource           @"reloadDataSource"                 // userInfo: ocId?, serverUrl?
 #define k_notificationCenter_reloadMediaDataSource      @"reloadMediaDataSource"
+#define k_notificationCenter_mediaFileNotFound          @"mediaFileNotFound"                // userInfo: metadata
 
 #define k_notificationCenter_downloadStartFile          @"downloadStartFile"                // userInfo: metadata
 #define k_notificationCenter_downloadedFile             @"downloadedFile"                   // userInfo: metadata, selector, errorCode, errorDescription

+ 1 - 0
iOSClient/Media/NCMedia.swift

@@ -100,6 +100,7 @@ class NCMedia: UIViewController, DZNEmptyDataSetSource, DZNEmptyDataSetDelegate,
         
         // Notification
         NotificationCenter.default.addObserver(self, selector: #selector(deleteFile(_:)), name: NSNotification.Name(rawValue: k_notificationCenter_deleteFile), object: nil)
+        NotificationCenter.default.addObserver(self, selector: #selector(deleteFile(_:)), name: NSNotification.Name(rawValue: k_notificationCenter_mediaFileNotFound), object: nil)
         NotificationCenter.default.addObserver(self, selector: #selector(changeTheming), name: NSNotification.Name(rawValue: k_notificationCenter_changeTheming), object: nil)
         NotificationCenter.default.addObserver(self, selector: #selector(moveFile(_:)), name: NSNotification.Name(rawValue: k_notificationCenter_moveFile), object: nil)
         NotificationCenter.default.addObserver(self, selector: #selector(renameFile(_:)), name: NSNotification.Name(rawValue: k_notificationCenter_renameFile), object: nil)

+ 1 - 1
iOSClient/Networking/NCOperationQueue.swift

@@ -458,7 +458,7 @@ class NCOperationReadFileForMediaQueue: ConcurrentOperation {
                     }
                 } else if errorCode == 404 {
                     NCManageDatabase.sharedInstance.deleteMetadata(predicate: NSPredicate(format: "ocId == %@", self.metadata.ocId))
-                    //NotificationCenter.default.postOnMainThread(name: k_notificationCenter_mediaFileNotFounf, userInfo: ["metadata": self.metadata])
+                    NotificationCenter.default.postOnMainThread(name: k_notificationCenter_mediaFileNotFound, userInfo: ["metadata": self.metadata])
                 }
                 self.finish()
             }