Prechádzať zdrojové kódy

add url on tableMetadata & tablePhotos

Marino Faggiana 6 rokov pred
rodič
commit
aaff6002a5

+ 4 - 2
iOSClient/Database/NCDatabase.swift

@@ -218,7 +218,8 @@ class tableMetadata: Object {
     @objc dynamic var size: Double = 0
     @objc dynamic var status: Int = 0
     @objc dynamic var typeFile = ""
-    
+    @objc dynamic var url = ""
+
     override static func primaryKey() -> String {
         return "fileID"
     }
@@ -251,7 +252,8 @@ class tablePhotos: Object {
     @objc dynamic var size: Double = 0
     @objc dynamic var status: Int = 0
     @objc dynamic var typeFile = ""
-    
+    @objc dynamic var url = ""
+
     override static func primaryKey() -> String {
         return "fileID"
     }

+ 2 - 1
iOSClient/Database/NCManageDatabase.swift

@@ -57,7 +57,7 @@ class NCManageDatabase: NSObject {
         let config = Realm.Configuration(
         
             fileURL: dirGroup?.appendingPathComponent("\(k_appDatabaseNextcloud)/\(k_databaseDefault)"),
-            schemaVersion: 31,
+            schemaVersion: 32,
             
             // 10 : Version 2.18.0
             // 11 : Version 2.18.2
@@ -81,6 +81,7 @@ class NCManageDatabase: NSObject {
             // 29 : Version 2.22.5.2
             // 30 : Version 2.22.6.0
             // 31 : Version 2.22.6.3
+            // 32 : Version 2.22.6.10
             
             migrationBlock: { migration, oldSchemaVersion in
                 // We haven’t migrated anything yet, so oldSchemaVersion == 0

+ 5 - 5
iOSClient/Main/Create cloud/NCCreateFormUploadRichdocuments.swift

@@ -263,11 +263,11 @@ class NCCreateFormUploadRichdocuments: XLFormViewController, NCSelectDelegate, U
         ocNetworking?.createNewRichdocuments(withFileName: fileName, serverUrl: serverUrl, templateID: "\(selectTemplate.templateID)", success: { (path) in
             if path != nil && path!.count > 0 {
 
-                
-                let metadataDetail = CCUtility.createMetadata(withAccount: self.appDelegate.activeAccount, date: Date(), directory: false, fileID: CCUtility.createRandomString(12), directoryID: directoryID, fileName: (fileNameForm as! NSString).deletingPathExtension + "." + self.fileNameExtension, etag: "", size: 0, status: Double(k_metadataStatusNormal))
-                
-                
-                
+                self.dismiss(animated: true, completion: {
+                    let metadata = CCUtility.createMetadata(withAccount: self.appDelegate.activeAccount, date: Date(), directory: false, fileID: CCUtility.createRandomString(12), directoryID: directoryID, fileName: (fileNameForm as! NSString).deletingPathExtension + "." + self.fileNameExtension, etag: "", size: 0, status: Double(k_metadataStatusNormal))
+                    
+                    self.appDelegate.activeMain.shouldPerformSegue(metadata)
+                })                
             }
         }, failure: { (message, errorCode) in
             self.appDelegate.messageNotification("_error_", description: message, visible: true, delay: TimeInterval(k_dismissAfterSecond), type: TWMessageBarMessageType.error, errorCode: errorCode)