|
@@ -96,6 +96,8 @@ class NCViewerMediaPage: UIViewController {
|
|
|
NotificationCenter.default.addObserver(self, selector: #selector(downloadedFile(_:)), name: NSNotification.Name(rawValue: NCGlobal.shared.notificationCenterDownloadedFile), object: nil)
|
|
|
NotificationCenter.default.addObserver(self, selector: #selector(triggerProgressTask(_:)), name: NSNotification.Name(rawValue: NCGlobal.shared.notificationCenterProgressTask), object: nil)
|
|
|
|
|
|
+ NotificationCenter.default.addObserver(self, selector: #selector(uploadedFile(_:)), name: NSNotification.Name(rawValue: NCGlobal.shared.notificationCenterUploadedFile), object: nil)
|
|
|
+
|
|
|
NotificationCenter.default.addObserver(self, selector: #selector(hidePlayerToolBar(_:)), name: NSNotification.Name(rawValue: NCGlobal.shared.notificationCenterHidePlayerToolBar), object: nil)
|
|
|
NotificationCenter.default.addObserver(self, selector: #selector(showPlayerToolBar(_:)), name: NSNotification.Name(rawValue: NCGlobal.shared.notificationCenterShowPlayerToolBar), object: nil)
|
|
|
|
|
@@ -228,6 +230,20 @@ class NCViewerMediaPage: UIViewController {
|
|
|
}
|
|
|
}
|
|
|
|
|
|
+ @objc func uploadedFile(_ notification: NSNotification) {
|
|
|
+
|
|
|
+ if let userInfo = notification.userInfo as NSDictionary? {
|
|
|
+ if let ocId = userInfo["ocId"] as? String, let metadata = NCManageDatabase.shared.getMetadataFromOcId(ocId), let errorCode = userInfo["errorCode"] as? Int {
|
|
|
+ if errorCode == 0, let index = metadatas.firstIndex(where: {$0.ocId == metadata.ocId}) {
|
|
|
+ metadatas[index] = metadata
|
|
|
+ if currentViewController.metadata.ocId == ocId {
|
|
|
+ currentViewController.reloadImage()
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
@objc func deleteFile(_ notification: NSNotification) {
|
|
|
|
|
|
if let userInfo = notification.userInfo as NSDictionary? {
|