瀏覽代碼

Merge pull request #2001 from nextcloud/fix/markdown

iOS 12.0,* don't detect markdown
Marino Faggiana 2 年之前
父節點
當前提交
2fb60f6100

+ 2 - 2
Nextcloud.xcodeproj/project.pbxproj

@@ -3006,7 +3006,7 @@
 				CLANG_WARN_UNREACHABLE_CODE = YES;
 				CLANG_WARN__DUPLICATE_METHOD_MATCH = YES;
 				COPY_PHASE_STRIP = NO;
-				CURRENT_PROJECT_VERSION = 9;
+				CURRENT_PROJECT_VERSION = 10;
 				DEVELOPMENT_TEAM = 6JLRKY9ZV7;
 				ENABLE_BITCODE = NO;
 				ENABLE_STRICT_OBJC_MSGSEND = YES;
@@ -3067,7 +3067,7 @@
 				CLANG_WARN_UNREACHABLE_CODE = YES;
 				CLANG_WARN__DUPLICATE_METHOD_MATCH = YES;
 				COPY_PHASE_STRIP = NO;
-				CURRENT_PROJECT_VERSION = 9;
+				CURRENT_PROJECT_VERSION = 10;
 				DEVELOPMENT_TEAM = 6JLRKY9ZV7;
 				ENABLE_BITCODE = NO;
 				ENABLE_STRICT_OBJC_MSGSEND = YES;

+ 4 - 0
iOSClient/Data/NCManageDatabase+Metadata.swift

@@ -87,6 +87,10 @@ extension NCManageDatabase {
         }
         metadata.size = file.size
         metadata.classFile = file.classFile
+        //FIXME: iOS 12.0,* don't detect UTI "text/markdown"
+        if metadata.contentType == "text/markdown" && metadata.classFile == NCCommunicationCommon.typeClassFile.unknow.rawValue {
+            metadata.classFile = NCCommunicationCommon.typeClassFile.document.rawValue
+        }
         if let date = file.uploadDate {
             metadata.uploadDate = date
         } else {

+ 4 - 0
iOSClient/Data/NCManageDatabase.swift

@@ -149,6 +149,10 @@ class NCManageDatabase: NSObject {
                         }
                     }
 
+                    if oldSchemaVersion < 220 {
+                        migration.deleteData(forType: tableMetadata.className())
+                    }
+
                 }, shouldCompactOnLaunch: { totalBytes, usedBytes in
 
                     // totalBytes refers to the size of the file on disk in bytes (data + free space)

+ 1 - 1
iOSClient/NCGlobal.swift

@@ -112,7 +112,7 @@ class NCGlobal: NSObject {
     // Database Realm
     //
     let databaseDefault                             = "nextcloud.realm"
-    let databaseSchemaVersion: UInt64               = 219
+    let databaseSchemaVersion: UInt64               = 220
 
     // Intro selector
     //