Browse Source

clear old code

Marino Faggiana 6 years ago
parent
commit
6aac0083d8

+ 1 - 1
File Provider Extension/FileProviderExtension+Actions.swift

@@ -226,7 +226,7 @@ extension FileProviderExtension {
                     _ = self.providerData.moveFile(CCUtility.getDirectoryProviderStorageFileID(itemIdentifier.rawValue, fileNameView: fileNameFrom), toPath: CCUtility.getDirectoryProviderStorageFileID(itemIdentifier.rawValue, fileNameView: itemName))
                     _ = self.providerData.moveFile(CCUtility.getDirectoryProviderStorageIconFileID(itemIdentifier.rawValue, fileNameView: fileNameFrom), toPath: CCUtility.getDirectoryProviderStorageIconFileID(itemIdentifier.rawValue, fileNameView: itemName))
                     
-                    NCManageDatabase.sharedInstance.setLocalFile(fileID: metadata.fileID, id: metadata.id, date: nil, exifDate: nil, exifLatitude: nil, exifLongitude: nil, fileName: itemName, etag: nil)
+                    NCManageDatabase.sharedInstance.setLocalFile(fileID: metadata.fileID, date: nil, exifDate: nil, exifLatitude: nil, exifLongitude: nil, fileName: itemName, etag: nil)
                 }
                 
                 guard let parentItemIdentifier = self.providerData.getParentItemIdentifier(metadata: metadata) else {

+ 1 - 1
File Provider Extension/FileProviderExtension.swift

@@ -249,7 +249,7 @@ class FileProviderExtension: NSFileProviderExtension, CCNetworkingDelegate {
                 metadata.date = date! as NSDate
                 metadata.etag = etag!
                 NCManageDatabase.sharedInstance.addLocalFile(metadata: metadata)
-                NCManageDatabase.sharedInstance.setLocalFile(fileID: metadata.fileID, id: metadata.id, date: date! as NSDate, exifDate: nil, exifLatitude: nil, exifLongitude: nil, fileName: nil, etag: etag)
+                NCManageDatabase.sharedInstance.setLocalFile(fileID: metadata.fileID, date: date! as NSDate, exifDate: nil, exifLatitude: nil, exifLongitude: nil, fileName: nil, etag: etag)
                 
                 // Update DB Metadata
                 _ = NCManageDatabase.sharedInstance.addMetadata(metadata)

+ 0 - 1
iOSClient/Database/NCDatabase.swift

@@ -236,7 +236,6 @@ class tableLocalFile: Object {
     @objc dynamic var favorite: Bool = false
     @objc dynamic var fileID = ""
     @objc dynamic var fileName = ""
-    @objc dynamic var id: Double = 0
     @objc dynamic var offline: Bool = false
     @objc dynamic var size: Double = 0
     

+ 3 - 7
iOSClient/Database/NCManageDatabase.swift

@@ -64,7 +64,7 @@ class NCManageDatabase: NSObject {
         var config = Realm.Configuration(
         
             fileURL: dirGroup?.appendingPathComponent("\(k_appDatabaseNextcloud)/\(k_databaseDefault)"),
-            schemaVersion: 42,
+            schemaVersion: 43,
             
             // 10 : Version 2.18.0
             // 11 : Version 2.18.2
@@ -98,7 +98,7 @@ class NCManageDatabase: NSObject {
             // 39 : Version 2.22.9.1
             // 40 : Version 2.22.9.3
             // 41 : Version 2.22.9.5
-            // 42 : Version 2.22.9.10
+            // 42,43 : Version 2.22.9.10
             
 
             migrationBlock: { migration, oldSchemaVersion in
@@ -1436,7 +1436,6 @@ class NCManageDatabase: NSObject {
                 addObject.exifLongitude = "-1"
                 addObject.fileID = metadata.fileID
                 addObject.fileName = metadata.fileName
-                addObject.id = metadata.id
                 addObject.size = metadata.size
             
                 realm.add(addObject, update: true)
@@ -1462,7 +1461,7 @@ class NCManageDatabase: NSObject {
         }
     }
     
-    @objc func setLocalFile(fileID: String, id: Double, date: NSDate?, exifDate: NSDate?, exifLatitude: String?, exifLongitude: String?, fileName: String?, etag: String?) {
+    @objc func setLocalFile(fileID: String, date: NSDate?, exifDate: NSDate?, exifLatitude: String?, exifLongitude: String?, fileName: String?, etag: String?) {
         
         let realm = try! Realm()
 
@@ -1492,9 +1491,6 @@ class NCManageDatabase: NSObject {
                 if let etag = etag {
                     result.etag = etag
                 }
-                if id > 0 {
-                    result.id = id
-                }
             }
         } catch let error {
             print("[LOG] Could not write to database: ", error)

+ 1 - 1
iOSClient/Main/CCMain.m

@@ -1548,7 +1548,7 @@
                                 
                             } else {
                                 
-                                [[NCManageDatabase sharedInstance] setLocalFileWithFileID:metadata.fileID id:metadata.id date:nil exifDate:nil exifLatitude:nil exifLongitude:nil fileName:fileNameNew etag:nil];
+                                [[NCManageDatabase sharedInstance] setLocalFileWithFileID:metadata.fileID date:nil exifDate:nil exifLatitude:nil exifLongitude:nil fileName:fileNameNew etag:nil];
                                 
                                 // Move file system
                                 

+ 1 - 1
iOSClient/Utility/CCExifGeo.m

@@ -113,7 +113,7 @@
 
     // Wite data EXIF in TableLocalFile
     if (tiff || gps)
-        [[NCManageDatabase sharedInstance] setLocalFileWithFileID:metadata.fileID id:metadata.id date:nil exifDate:date exifLatitude:stringLatitude exifLongitude:stringLongitude fileName:nil etag:nil];
+        [[NCManageDatabase sharedInstance] setLocalFileWithFileID:metadata.fileID date:nil exifDate:date exifLatitude:stringLatitude exifLongitude:stringLongitude fileName:nil etag:nil];
     
     CFRelease(originalSource);
     CFRelease(imageProperties);