소스 검색

fix #2000

Signed-off-by: marinofaggiana <ios@nextcloud.com>
marinofaggiana 2 년 전
부모
커밋
a48ded52c5
3개의 변경된 파일9개의 추가작업 그리고 1개의 파일을 삭제
  1. 4 0
      iOSClient/Data/NCManageDatabase+Metadata.swift
  2. 4 0
      iOSClient/Data/NCManageDatabase.swift
  3. 1 1
      iOSClient/NCGlobal.swift

+ 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
     //