|
@@ -1094,19 +1094,19 @@ class NCMainCommon: NSObject, PhotoEditorDelegate, NCAudioRecorderViewController
|
|
print("Canceled")
|
|
print("Canceled")
|
|
}
|
|
}
|
|
|
|
|
|
- //MARK: - OpenIn
|
|
|
|
|
|
+ //MARK: - download Open Selector
|
|
|
|
|
|
- @objc func downloadOpenIn(metadata: tableMetadata) {
|
|
|
|
|
|
+ @objc func downloadOpen(metadata: tableMetadata, selector: String) {
|
|
|
|
|
|
if CCUtility.fileProviderStorageExists(metadata.ocId, fileNameView: metadata.fileNameView) {
|
|
if CCUtility.fileProviderStorageExists(metadata.ocId, fileNameView: metadata.fileNameView) {
|
|
|
|
|
|
- openIn(metadata: metadata)
|
|
|
|
-
|
|
|
|
|
|
+ NCNetworkingMain.sharedInstance.downloadFileSuccessFailure(metadata.fileName, ocId: metadata.ocId, serverUrl: metadata.serverUrl, selector: selector, errorMessage: "", errorCode: 0)
|
|
|
|
+
|
|
} else {
|
|
} else {
|
|
|
|
|
|
metadata.session = k_download_session
|
|
metadata.session = k_download_session
|
|
metadata.sessionError = ""
|
|
metadata.sessionError = ""
|
|
- metadata.sessionSelector = selectorOpenIn
|
|
|
|
|
|
+ metadata.sessionSelector = selector //selectorOpenIn
|
|
metadata.status = Int(k_metadataStatusWaitDownload)
|
|
metadata.status = Int(k_metadataStatusWaitDownload)
|
|
|
|
|
|
_ = NCManageDatabase.sharedInstance.addMetadata(metadata)
|
|
_ = NCManageDatabase.sharedInstance.addMetadata(metadata)
|
|
@@ -1114,6 +1114,8 @@ class NCMainCommon: NSObject, PhotoEditorDelegate, NCAudioRecorderViewController
|
|
}
|
|
}
|
|
}
|
|
}
|
|
|
|
|
|
|
|
+ //MARK: - OpenIn
|
|
|
|
+
|
|
func openIn(metadata: tableMetadata) {
|
|
func openIn(metadata: tableMetadata) {
|
|
|
|
|
|
docController = UIDocumentInteractionController(url: NSURL(fileURLWithPath: CCUtility.getDirectoryProviderStorageOcId(metadata.ocId, fileNameView: metadata.fileNameView)) as URL)
|
|
docController = UIDocumentInteractionController(url: NSURL(fileURLWithPath: CCUtility.getDirectoryProviderStorageOcId(metadata.ocId, fileNameView: metadata.fileNameView)) as URL)
|