marinofaggiana 4 gadi atpakaļ
vecāks
revīzija
a8d4f78591

+ 1 - 1
Cartfile.resolved

@@ -20,7 +20,7 @@ github "marinofaggiana/AFNetworking" "2967678c3e0e98c9b8d7e06222ad12d1f49c26f2"
 github "marinofaggiana/KTVHTTPCache" "2.0.2"
 github "marinofaggiana/TOPasscodeViewController" "0.0.6"
 github "marinofaggiana/XLForm" "eb9381ad8129f60402bf412250fb31b95a628a08"
-github "nextcloud/ios-communication-library" "4e1050c73a87baa4240855bf2e67c832fc880fee"
+github "nextcloud/ios-communication-library" "3f6adedb5904e3cbf9f87dd3e5dd62ffba67cee7"
 github "realm/realm-cocoa" "v4.4.1"
 github "rechsteiner/Parchment" "v1.7.0"
 github "scenee/FloatingPanel" "v1.7.5"

+ 8 - 8
Nextcloud.xcodeproj/project.pbxproj

@@ -2480,7 +2480,7 @@
 				CODE_SIGN_IDENTITY = "iPhone Developer";
 				"CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer";
 				CODE_SIGN_STYLE = Automatic;
-				CURRENT_PROJECT_VERSION = 65;
+				CURRENT_PROJECT_VERSION = 66;
 				DEBUG_INFORMATION_FORMAT = dwarf;
 				DEVELOPMENT_TEAM = 6JLRKY9ZV7;
 				FRAMEWORK_SEARCH_PATHS = (
@@ -2531,7 +2531,7 @@
 				CODE_SIGN_IDENTITY = "iPhone Developer";
 				"CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer";
 				CODE_SIGN_STYLE = Automatic;
-				CURRENT_PROJECT_VERSION = 65;
+				CURRENT_PROJECT_VERSION = 66;
 				DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym";
 				DEVELOPMENT_TEAM = 6JLRKY9ZV7;
 				FRAMEWORK_SEARCH_PATHS = (
@@ -2574,7 +2574,7 @@
 				CODE_SIGN_ENTITLEMENTS = iOSClient/Brand/Share.entitlements;
 				CODE_SIGN_IDENTITY = "iPhone Developer";
 				"CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer";
-				CURRENT_PROJECT_VERSION = 65;
+				CURRENT_PROJECT_VERSION = 66;
 				DEBUG_INFORMATION_FORMAT = dwarf;
 				DEVELOPMENT_TEAM = 6JLRKY9ZV7;
 				FRAMEWORK_SEARCH_PATHS = (
@@ -2618,7 +2618,7 @@
 				CODE_SIGN_ENTITLEMENTS = iOSClient/Brand/Share.entitlements;
 				CODE_SIGN_IDENTITY = "iPhone Developer";
 				"CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer";
-				CURRENT_PROJECT_VERSION = 65;
+				CURRENT_PROJECT_VERSION = 66;
 				DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym";
 				DEVELOPMENT_TEAM = 6JLRKY9ZV7;
 				FRAMEWORK_SEARCH_PATHS = (
@@ -2668,7 +2668,7 @@
 				CODE_SIGN_IDENTITY = "iPhone Developer";
 				"CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer";
 				CODE_SIGN_STYLE = Automatic;
-				CURRENT_PROJECT_VERSION = 65;
+				CURRENT_PROJECT_VERSION = 66;
 				DEBUG_INFORMATION_FORMAT = dwarf;
 				DEVELOPMENT_TEAM = 6JLRKY9ZV7;
 				FRAMEWORK_SEARCH_PATHS = (
@@ -2718,7 +2718,7 @@
 				CODE_SIGN_IDENTITY = "iPhone Developer";
 				"CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer";
 				CODE_SIGN_STYLE = Automatic;
-				CURRENT_PROJECT_VERSION = 65;
+				CURRENT_PROJECT_VERSION = 66;
 				DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym";
 				DEVELOPMENT_TEAM = 6JLRKY9ZV7;
 				FRAMEWORK_SEARCH_PATHS = (
@@ -2760,7 +2760,7 @@
 				CODE_SIGN_ENTITLEMENTS = iOSClient/Brand/iOSClient.entitlements;
 				CODE_SIGN_IDENTITY = "iPhone Developer";
 				"CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer";
-				CURRENT_PROJECT_VERSION = 65;
+				CURRENT_PROJECT_VERSION = 66;
 				DEVELOPMENT_TEAM = 6JLRKY9ZV7;
 				ENABLE_BITCODE = YES;
 				FRAMEWORK_SEARCH_PATHS = (
@@ -2805,7 +2805,7 @@
 				CODE_SIGN_IDENTITY = "iPhone Developer";
 				"CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer";
 				COPY_PHASE_STRIP = NO;
-				CURRENT_PROJECT_VERSION = 65;
+				CURRENT_PROJECT_VERSION = 66;
 				DEVELOPMENT_TEAM = 6JLRKY9ZV7;
 				ENABLE_BITCODE = YES;
 				FRAMEWORK_SEARCH_PATHS = (

+ 1 - 1
iOSClient/CCGlobal.h

@@ -84,7 +84,7 @@
 
 // Database Realm
 #define k_databaseDefault                               @"nextcloud.realm"
-#define k_databaseSchemaVersion                         109
+#define k_databaseSchemaVersion                         110
 
 // Intro selector
 #define k_intro_login                                   0

+ 3 - 1
iOSClient/Database/NCDatabase.swift

@@ -337,7 +337,8 @@ class tableMedia: Object {
     @objc dynamic var typeFile = ""
     @objc dynamic var uploadDate = NSDate()
     @objc dynamic var url = ""
-    
+    @objc dynamic var urlBase = ""
+
     override static func primaryKey() -> String {
         return "ocId"
     }
@@ -384,6 +385,7 @@ class tableMetadata: Object {
     @objc dynamic var typeFile = ""
     @objc dynamic var uploadDate = NSDate()
     @objc dynamic var url = ""
+    @objc dynamic var urlBase = ""
 
     override static func primaryKey() -> String {
         return "ocId"

+ 8 - 25
iOSClient/Database/NCManageDatabase.swift

@@ -62,13 +62,7 @@ class NCManageDatabase: NSObject {
                 schemaVersion: UInt64(k_databaseSchemaVersion),
                 
                 migrationBlock: { migration, oldSchemaVersion in
-                    
-                    if oldSchemaVersion < 41 {
-                        migration.deleteData(forType: tableActivity.className())
-                        migration.deleteData(forType: tableMetadata.className())
-                        migration.deleteData(forType: tableDirectory.className())
-                    }
-                    
+                                        
                     if oldSchemaVersion < 61 {
                         migration.deleteData(forType: tableShare.className())
                     }
@@ -92,29 +86,12 @@ class NCManageDatabase: NSObject {
                         }
                     }
                     
-                    if oldSchemaVersion < 78 {
-                        migration.deleteData(forType: tableActivity.className())
-                        migration.deleteData(forType: tableActivityPreview.className())
-                        migration.deleteData(forType: tableActivitySubjectRich.className())
-                        migration.deleteData(forType: tableComments.className())
-                        migration.deleteData(forType: tableDirectory.className())
-                        migration.deleteData(forType: tableMetadata.className())
-                        migration.deleteData(forType: tableMedia.className())
-                        migration.deleteData(forType: tableE2eEncryptionLock.className())
-                        migration.deleteData(forType: tableTag.className())
-                        migration.deleteData(forType: tableTrash.className())
-                    }
-                    
                     if oldSchemaVersion < 87 {
                         migration.deleteData(forType: tableActivity.className())
                         migration.deleteData(forType: tableActivityPreview.className())
                         migration.deleteData(forType: tableActivitySubjectRich.className())
-                        migration.deleteData(forType: tableCapabilities.className())
-                        migration.deleteData(forType: tableComments.className())
                         migration.deleteData(forType: tableDirectEditingCreators.className())
                         migration.deleteData(forType: tableDirectEditingEditors.className())
-                        migration.deleteData(forType: tableDirectory.className())
-                        migration.deleteData(forType: tableE2eEncryptionLock.className())
                         migration.deleteData(forType: tableExternalSites.className())
                         migration.deleteData(forType: tableGPS.className())
                         migration.deleteData(forType: tableShare.className())
@@ -125,7 +102,6 @@ class NCManageDatabase: NSObject {
                     if oldSchemaVersion < 95 {
                         migration.deleteData(forType: tableE2eEncryptionLock.className())
                         migration.deleteData(forType: tableDirectory.className())
-                        migration.deleteData(forType: tableMetadata.className())
                     }
                     
                     if oldSchemaVersion < 104 {
@@ -136,6 +112,11 @@ class NCManageDatabase: NSObject {
                         migration.deleteData(forType: tableComments.className())
                     }
                     
+                    if oldSchemaVersion < 110 {
+                        migration.deleteData(forType: tableMetadata.className())
+                        migration.deleteData(forType: tableMedia.className())
+                    }
+                    
                 }, shouldCompactOnLaunch: { totalBytes, usedBytes in
                     
                     // totalBytes refers to the size of the file on disk in bytes (data + free space)
@@ -1769,6 +1750,7 @@ class NCManageDatabase: NSObject {
         } else {
             metadata.uploadDate = file.date
         }
+        metadata.urlBase = file.urlBase
         
         // E2EE find the fileName for fileNameView
         if isEncrypted || metadata.e2eEncrypted {
@@ -1926,6 +1908,7 @@ class NCManageDatabase: NSObject {
                     } else {
                         metadata.uploadDate = file.date
                     }
+                    metadata.urlBase = file.urlBase
                     
                     realm.add(metadata, update: .all)
                 }