Browse Source

Versione 6.1.0 (#3140)

Marino Faggiana 5 months ago
parent
commit
60f9f925a8
100 changed files with 232 additions and 135 deletions
  1. 1 1
      Brand/Database.swift
  2. 4 4
      Nextcloud.xcodeproj/project.pbxproj
  3. 2 2
      Share/NCShareExtension+Files.swift
  4. 1 1
      iOSClient/Color/NCColorPicker.swift
  5. 1 0
      iOSClient/Data/NCManageDatabase+Account.swift
  6. 28 25
      iOSClient/Data/NCManageDatabase+Directory.swift
  7. 50 12
      iOSClient/Data/NCManageDatabase+Metadata.swift
  8. 4 3
      iOSClient/Favorites/NCFavorite.swift
  9. 6 5
      iOSClient/Files/NCFiles.swift
  10. 6 4
      iOSClient/Groupfolders/NCGroupfolders.swift
  11. 7 6
      iOSClient/Main/Collection Common/NCCollectionViewCommon.swift
  12. 2 10
      iOSClient/Main/Collection Common/NCCollectionViewDataSource.swift
  13. 3 2
      iOSClient/Menu/NCCollectionViewCommon+Menu.swift
  14. 3 0
      iOSClient/NCGlobal.swift
  15. 8 0
      iOSClient/Networking/E2EE/NCEndToEndMetadataV20.swift
  16. 1 1
      iOSClient/Networking/E2EE/NCNetworkingE2EEMarkFolder.swift
  17. 11 12
      iOSClient/Networking/E2EE/NCNetworkingE2EEUpload.swift
  18. 6 2
      iOSClient/Networking/NCAutoUpload.swift
  19. 37 20
      iOSClient/Networking/NCNetworkingProcess.swift
  20. 1 5
      iOSClient/Networking/NCService.swift
  21. 6 4
      iOSClient/Offline/NCOffline.swift
  22. 6 2
      iOSClient/Recent/NCRecent.swift
  23. 1 1
      iOSClient/RichWorkspace/NCViewerRichWorkspace.swift
  24. 4 2
      iOSClient/SceneDelegate.swift
  25. 9 6
      iOSClient/Select/NCSelect.swift
  26. 11 0
      iOSClient/Settings/AutoUpload/NCAutoUploadModel.swift
  27. 9 0
      iOSClient/Settings/AutoUpload/NCAutoUploadView.swift
  28. 0 2
      iOSClient/Settings/Display/NCDisplayView.swift
  29. 2 2
      iOSClient/Shares/NCShares.swift
  30. BIN
      iOSClient/Supporting Files/af.lproj/Localizable.strings
  31. BIN
      iOSClient/Supporting Files/an.lproj/Localizable.strings
  32. BIN
      iOSClient/Supporting Files/ar.lproj/InfoPlist.strings
  33. BIN
      iOSClient/Supporting Files/ar.lproj/Localizable.strings
  34. BIN
      iOSClient/Supporting Files/ast.lproj/Localizable.strings
  35. BIN
      iOSClient/Supporting Files/az.lproj/Localizable.strings
  36. BIN
      iOSClient/Supporting Files/be.lproj/Localizable.strings
  37. BIN
      iOSClient/Supporting Files/bg_BG.lproj/Localizable.strings
  38. BIN
      iOSClient/Supporting Files/bn_BD.lproj/Localizable.strings
  39. BIN
      iOSClient/Supporting Files/br.lproj/Localizable.strings
  40. BIN
      iOSClient/Supporting Files/bs.lproj/Localizable.strings
  41. BIN
      iOSClient/Supporting Files/ca.lproj/Localizable.strings
  42. BIN
      iOSClient/Supporting Files/cs-CZ.lproj/Localizable.strings
  43. BIN
      iOSClient/Supporting Files/cy_GB.lproj/Localizable.strings
  44. BIN
      iOSClient/Supporting Files/da.lproj/Localizable.strings
  45. BIN
      iOSClient/Supporting Files/de.lproj/Localizable.strings
  46. BIN
      iOSClient/Supporting Files/el.lproj/Localizable.strings
  47. BIN
      iOSClient/Supporting Files/en-GB.lproj/Localizable.strings
  48. 2 1
      iOSClient/Supporting Files/en.lproj/Localizable.strings
  49. BIN
      iOSClient/Supporting Files/eo.lproj/Localizable.strings
  50. BIN
      iOSClient/Supporting Files/es-419.lproj/Localizable.strings
  51. BIN
      iOSClient/Supporting Files/es-AR.lproj/Localizable.strings
  52. BIN
      iOSClient/Supporting Files/es-CL.lproj/Localizable.strings
  53. BIN
      iOSClient/Supporting Files/es-CO.lproj/Localizable.strings
  54. BIN
      iOSClient/Supporting Files/es-CR.lproj/Localizable.strings
  55. BIN
      iOSClient/Supporting Files/es-DO.lproj/Localizable.strings
  56. BIN
      iOSClient/Supporting Files/es-EC.lproj/Localizable.strings
  57. BIN
      iOSClient/Supporting Files/es-GT.lproj/Localizable.strings
  58. BIN
      iOSClient/Supporting Files/es-HN.lproj/Localizable.strings
  59. BIN
      iOSClient/Supporting Files/es-MX.lproj/Localizable.strings
  60. BIN
      iOSClient/Supporting Files/es-NI.lproj/Localizable.strings
  61. BIN
      iOSClient/Supporting Files/es-PA.lproj/Localizable.strings
  62. BIN
      iOSClient/Supporting Files/es-PE.lproj/Localizable.strings
  63. BIN
      iOSClient/Supporting Files/es-PR.lproj/Localizable.strings
  64. BIN
      iOSClient/Supporting Files/es-PY.lproj/Localizable.strings
  65. BIN
      iOSClient/Supporting Files/es-SV.lproj/Localizable.strings
  66. BIN
      iOSClient/Supporting Files/es-UY.lproj/Localizable.strings
  67. BIN
      iOSClient/Supporting Files/es.lproj/Localizable.strings
  68. BIN
      iOSClient/Supporting Files/et_EE.lproj/Localizable.strings
  69. BIN
      iOSClient/Supporting Files/eu.lproj/Localizable.strings
  70. BIN
      iOSClient/Supporting Files/fa.lproj/Localizable.strings
  71. BIN
      iOSClient/Supporting Files/fi-FI.lproj/Localizable.strings
  72. BIN
      iOSClient/Supporting Files/fo.lproj/Localizable.strings
  73. BIN
      iOSClient/Supporting Files/fr.lproj/Localizable.strings
  74. BIN
      iOSClient/Supporting Files/ga.lproj/Localizable.strings
  75. BIN
      iOSClient/Supporting Files/gd.lproj/Localizable.strings
  76. BIN
      iOSClient/Supporting Files/gl.lproj/Localizable.strings
  77. BIN
      iOSClient/Supporting Files/he.lproj/Localizable.strings
  78. BIN
      iOSClient/Supporting Files/hi_IN.lproj/Localizable.strings
  79. BIN
      iOSClient/Supporting Files/hr.lproj/Localizable.strings
  80. BIN
      iOSClient/Supporting Files/hsb.lproj/Localizable.strings
  81. BIN
      iOSClient/Supporting Files/hu.lproj/Localizable.strings
  82. BIN
      iOSClient/Supporting Files/hy.lproj/Localizable.strings
  83. BIN
      iOSClient/Supporting Files/ia.lproj/Localizable.strings
  84. BIN
      iOSClient/Supporting Files/id.lproj/Localizable.strings
  85. BIN
      iOSClient/Supporting Files/ig.lproj/Localizable.strings
  86. BIN
      iOSClient/Supporting Files/is.lproj/Localizable.strings
  87. BIN
      iOSClient/Supporting Files/it.lproj/Localizable.strings
  88. BIN
      iOSClient/Supporting Files/ja-JP.lproj/Localizable.strings
  89. BIN
      iOSClient/Supporting Files/ka-GE.lproj/Localizable.strings
  90. BIN
      iOSClient/Supporting Files/ka.lproj/Localizable.strings
  91. BIN
      iOSClient/Supporting Files/kab.lproj/Localizable.strings
  92. BIN
      iOSClient/Supporting Files/km.lproj/Localizable.strings
  93. BIN
      iOSClient/Supporting Files/kn.lproj/Localizable.strings
  94. BIN
      iOSClient/Supporting Files/ko.lproj/Localizable.strings
  95. BIN
      iOSClient/Supporting Files/la.lproj/Localizable.strings
  96. BIN
      iOSClient/Supporting Files/lb.lproj/Localizable.strings
  97. BIN
      iOSClient/Supporting Files/lo.lproj/Localizable.strings
  98. BIN
      iOSClient/Supporting Files/lt_LT.lproj/Localizable.strings
  99. BIN
      iOSClient/Supporting Files/lv.lproj/Localizable.strings
  100. BIN
      iOSClient/Supporting Files/mk.lproj/Localizable.strings

+ 1 - 1
Brand/Database.swift

@@ -26,4 +26,4 @@ import Foundation
 // Database Realm
 //
 let databaseName                    = "nextcloud.realm"
-let databaseSchemaVersion: UInt64   = 365
+let databaseSchemaVersion: UInt64   = 366

+ 4 - 4
Nextcloud.xcodeproj/project.pbxproj

@@ -5682,7 +5682,7 @@
 				CLANG_WARN_UNREACHABLE_CODE = YES;
 				CLANG_WARN__DUPLICATE_METHOD_MATCH = YES;
 				COPY_PHASE_STRIP = NO;
-				CURRENT_PROJECT_VERSION = 36;
+				CURRENT_PROJECT_VERSION = 4;
 				DEBUG_INFORMATION_FORMAT = dwarf;
 				DEVELOPMENT_TEAM = NKUJUXUJ3B;
 				ENABLE_STRICT_OBJC_MSGSEND = YES;
@@ -5709,7 +5709,7 @@
 					"@executable_path/Frameworks",
 					"@executable_path/../../Frameworks",
 				);
-				MARKETING_VERSION = 6.0.0;
+				MARKETING_VERSION = 6.1.0;
 				ONLY_ACTIVE_ARCH = YES;
 				OTHER_CFLAGS = "-v";
 				OTHER_LDFLAGS = "";
@@ -5748,7 +5748,7 @@
 				CLANG_WARN_UNREACHABLE_CODE = YES;
 				CLANG_WARN__DUPLICATE_METHOD_MATCH = YES;
 				COPY_PHASE_STRIP = NO;
-				CURRENT_PROJECT_VERSION = 36;
+				CURRENT_PROJECT_VERSION = 4;
 				DEVELOPMENT_TEAM = NKUJUXUJ3B;
 				ENABLE_STRICT_OBJC_MSGSEND = YES;
 				ENABLE_TESTABILITY = YES;
@@ -5772,7 +5772,7 @@
 					"@executable_path/Frameworks",
 					"@executable_path/../../Frameworks",
 				);
-				MARKETING_VERSION = 6.0.0;
+				MARKETING_VERSION = 6.1.0;
 				ONLY_ACTIVE_ARCH = YES;
 				OTHER_CFLAGS = "-v";
 				OTHER_LDFLAGS = "";

+ 2 - 2
Share/NCShareExtension+Files.swift

@@ -29,9 +29,9 @@ import NextcloudKit
 extension NCShareExtension {
     @objc func reloadDatasource(withLoadFolder: Bool) {
         let predicate = NSPredicate(format: "account == %@ AND serverUrl == %@ AND directory == true", session.account, serverUrl)
-        let results = self.database.getResultsMetadatasPredicate(predicate, layoutForView: NCDBLayoutForView())
+        let metadatas = self.database.getResultsMetadatasPredicate(predicate, layoutForView: NCDBLayoutForView())
 
-        self.dataSource = NCCollectionViewDataSource(results: results)
+        self.dataSource = NCCollectionViewDataSource(metadatas: metadatas)
 
         if withLoadFolder {
             loadFolder()

+ 1 - 1
iOSClient/Color/NCColorPicker.swift

@@ -212,7 +212,7 @@ class NCColorPicker: UIViewController {
     func updateColor(hexColor: String?) {
         if let metadata = metadata {
             let serverUrl = metadata.serverUrl + "/" + metadata.fileName
-            NCManageDatabase.shared.setDirectory(serverUrl: serverUrl, colorFolder: hexColor, metadata: metadata)
+            NCManageDatabase.shared.updateDirectoryColorFolder(hexColor, metadata: metadata, serverUrl: serverUrl)
             self.dismiss(animated: true)
             NotificationCenter.default.postOnMainThread(name: NCGlobal.shared.notificationCenterReloadDataSource, userInfo: ["serverUrl": metadata.serverUrl, "clearDataSource": true])
         }

+ 1 - 0
iOSClient/Data/NCManageDatabase+Account.swift

@@ -39,6 +39,7 @@ class tableAccount: Object {
     @objc dynamic var autoUploadFull: Bool = false
     @objc dynamic var autoUploadImage: Bool = false
     @objc dynamic var autoUploadVideo: Bool = false
+    @objc dynamic var autoUploadFavoritesOnly: Bool = false
     @objc dynamic var autoUploadWWAnPhoto: Bool = false
     @objc dynamic var autoUploadWWAnVideo: Bool = false
     @objc dynamic var backend = ""

+ 28 - 25
iOSClient/Data/NCManageDatabase+Directory.swift

@@ -76,16 +76,6 @@ extension NCManageDatabase {
         }
     }
 
-    func addDirectory(directory: tableDirectory, metadata: tableMetadata) {
-        directory.account = metadata.account
-        directory.e2eEncrypted = metadata.e2eEncrypted
-        directory.favorite = metadata.favorite
-        directory.fileId = metadata.fileId
-        directory.ocId = metadata.ocId
-        directory.permissions = metadata.permissions
-        directory.richWorkspace = metadata.richWorkspace
-    }
-
     func deleteDirectoryAndSubDirectory(serverUrl: String, account: String) {
 #if !EXTENSION
         DispatchQueue.main.async {
@@ -101,11 +91,15 @@ extension NCManageDatabase {
         do {
             let realm = try Realm()
             let results = realm.objects(tableDirectory.self).filter("account == %@ AND serverUrl BEGINSWITH %@", account, serverUrl)
-            for result in results {
-                self.deleteMetadata(predicate: NSPredicate(format: "account == %@ AND serverUrl == %@", result.account, result.serverUrl))
-                self.deleteLocalFileOcId(result.ocId)
-            }
             try realm.write {
+                for result in results {
+                    let metadatas = realm.objects(tableMetadata.self).filter("account == %@ AND serverUrl == %@", account, result.serverUrl)
+                    for metadata in metadatas {
+                        let localFile = realm.objects(tableLocalFile.self).filter("ocId == %@", metadata.ocId)
+                        realm.delete(localFile)
+                    }
+                    realm.delete(metadatas)
+                }
                 realm.delete(results)
             }
         } catch let error {
@@ -216,9 +210,17 @@ extension NCManageDatabase {
                     result.offline = offline
                 } else {
                     let directory = tableDirectory()
+
+                    directory.account = metadata.account
                     directory.serverUrl = serverUrl
                     directory.offline = offline
-                    addDirectory(directory: directory, metadata: metadata)
+                    directory.e2eEncrypted = metadata.e2eEncrypted
+                    directory.favorite = metadata.favorite
+                    directory.fileId = metadata.fileId
+                    directory.ocId = metadata.ocId
+                    directory.permissions = metadata.permissions
+                    directory.richWorkspace = metadata.richWorkspace
+
                     realm.add(directory, update: .all)
                 }
             }
@@ -239,8 +241,7 @@ extension NCManageDatabase {
         }
     }
 
-    @discardableResult
-    func setDirectory(serverUrl: String, richWorkspace: String?, account: String) -> tableDirectory? {
+    func updateDirectoryRichWorkspace(_ richWorkspace: String?, account: String, serverUrl: String) {
         var result: tableDirectory?
 
         do {
@@ -252,15 +253,9 @@ extension NCManageDatabase {
         } catch let error {
             NextcloudKit.shared.nkCommonInstance.writeLog("[ERROR] Could not write to database: \(error)")
         }
-
-        if let result = result {
-            return tableDirectory.init(value: result)
-        } else {
-            return nil
-        }
     }
 
-    func setDirectory(serverUrl: String, colorFolder: String?, metadata: tableMetadata) {
+    func updateDirectoryColorFolder(_ colorFolder: String?, metadata: tableMetadata, serverUrl: String) {
         do {
             let realm = try Realm()
             try realm.write {
@@ -268,9 +263,17 @@ extension NCManageDatabase {
                     result.colorFolder = colorFolder
                 } else {
                     let directory = tableDirectory()
+
+                    directory.account = metadata.account
                     directory.serverUrl = serverUrl
                     directory.colorFolder = colorFolder
-                    addDirectory(directory: directory, metadata: metadata)
+                    directory.e2eEncrypted = metadata.e2eEncrypted
+                    directory.favorite = metadata.favorite
+                    directory.fileId = metadata.fileId
+                    directory.ocId = metadata.ocId
+                    directory.permissions = metadata.permissions
+                    directory.richWorkspace = metadata.richWorkspace
+
                     realm.add(directory)
                 }
             }

+ 50 - 12
iOSClient/Data/NCManageDatabase+Metadata.swift

@@ -564,18 +564,33 @@ extension NCManageDatabase {
 
     // MARK: - Set
 
-    @discardableResult
-    func addMetadata(_ metadata: tableMetadata) -> tableMetadata? {
+    func createMetadata(_ metadata: tableMetadata) -> tableMetadata? {
         do {
             let realm = try Realm()
+            var managedMetadata: tableMetadata?
             try realm.write {
-                realm.add(tableMetadata(value: metadata), update: .all)
+                managedMetadata = realm.create(tableMetadata.self, value: metadata, update: .all)
+            }
+            if let managedMetadata {
+                return tableMetadata(value: managedMetadata)
+            }
+        } catch let error {
+            NextcloudKit.shared.nkCommonInstance.writeLog("[ERROR] Could not write to database: \(error)")
+        }
+
+        return nil
+    }
+
+    func addMetadata(_ metadata: tableMetadata) {
+        let metadata = tableMetadata(value: metadata)
+        do {
+            let realm = try Realm()
+            try realm.write {
+                realm.add(metadata, update: .all)
             }
         } catch let error {
             NextcloudKit.shared.nkCommonInstance.writeLog("[ERROR] Could not write to database: \(error)")
-            return nil
         }
-        return tableMetadata(value: metadata)
     }
 
     func addMetadatas(_ metadatas: [tableMetadata]) {
@@ -1046,22 +1061,45 @@ extension NCManageDatabase {
 
     // MARK: - GetResult(s)Metadata
 
-    func getResultsMetadatasPredicate(_ predicate: NSPredicate, layoutForView: NCDBLayoutForView?) -> Results<tableMetadata>? {
+    func getResultsMetadatasPredicate(_ predicate: NSPredicate, layoutForView: NCDBLayoutForView?) -> [tableMetadata] {
         do {
             let realm = try Realm()
-            var results = realm.objects(tableMetadata.self).filter(predicate)
+            var results = realm.objects(tableMetadata.self).filter(predicate).freeze()
             if let layoutForView {
-                if layoutForView.directoryOnTop {
-                    results = results.sorted(byKeyPath: layoutForView.sort, ascending: layoutForView.ascending).sorted(byKeyPath: "directory", ascending: false).sorted(byKeyPath: "favorite", ascending: false)
+                if layoutForView.sort == "fileName" {
+                    let sortedResults = results.sorted {
+                        // 1. favorite order
+                        if $0.favorite == $1.favorite {
+                            // 2. directory order TOP
+                            if layoutForView.directoryOnTop {
+                                if $0.directory == $1.directory {
+                                    // 3. natural fileName
+                                    return $0.fileNameView.localizedStandardCompare($1.fileNameView) == .orderedAscending
+                                } else {
+                                    return $0.directory && !$1.directory
+                                }
+                            } else {
+                                return $0.fileNameView.localizedStandardCompare($1.fileNameView) == .orderedAscending
+                            }
+                        } else {
+                            return $0.favorite && !$1.favorite
+                        }
+                    }
+                    return sortedResults
                 } else {
-                    results = results.sorted(byKeyPath: layoutForView.sort, ascending: layoutForView.ascending).sorted(byKeyPath: "favorite", ascending: false)
+                    if layoutForView.directoryOnTop {
+                        results = results.sorted(byKeyPath: layoutForView.sort, ascending: layoutForView.ascending).sorted(byKeyPath: "directory", ascending: false).sorted(byKeyPath: "favorite", ascending: false)
+                    } else {
+                        results = results.sorted(byKeyPath: layoutForView.sort, ascending: layoutForView.ascending).sorted(byKeyPath: "favorite", ascending: false)
+                    }
                 }
             }
-            return results
+            return Array(results)
+
         } catch let error as NSError {
             NextcloudKit.shared.nkCommonInstance.writeLog("[ERROR] Could not access database: \(error)")
         }
-        return nil
+        return []
     }
 
     func getResultsMetadatas(predicate: NSPredicate, sortedByKeyPath: String, ascending: Bool, arraySlice: Int) -> [tableMetadata] {

+ 4 - 3
iOSClient/Favorites/NCFavorite.swift

@@ -59,11 +59,12 @@ class NCFavorite: NCCollectionViewCommon {
         var predicate = self.defaultPredicate
 
         if self.serverUrl.isEmpty {
-           predicate = NSPredicate(format: "account == %@ AND favorite == true", session.account)
+           predicate = NSPredicate(format: "account == %@ AND favorite == true AND NOT (status IN %@)", session.account, global.metadataStatusHideInView)
         }
 
-        let results = self.database.getResultsMetadatasPredicate(predicate, layoutForView: layoutForView)
-        self.dataSource = NCCollectionViewDataSource(results: results, layoutForView: layoutForView)
+        let metadatas = self.database.getResultsMetadatasPredicate(predicate, layoutForView: layoutForView)
+
+        self.dataSource = NCCollectionViewDataSource(metadatas: metadatas, layoutForView: layoutForView)
 
         super.reloadDataSource()
     }

+ 6 - 5
iOSClient/Files/NCFiles.swift

@@ -131,13 +131,13 @@ class NCFiles: NCCollectionViewCommon {
         self.metadataFolder = database.getMetadataFolder(session: session, serverUrl: self.serverUrl)
         self.richWorkspaceText = database.getTableDirectory(predicate: predicateDirectory)?.richWorkspace
 
-        let results = self.database.getResultsMetadatasPredicate(predicate, layoutForView: layoutForView)
-        self.dataSource = NCCollectionViewDataSource(results: results, layoutForView: layoutForView)
+        let metadatas = self.database.getResultsMetadatasPredicate(predicate, layoutForView: layoutForView)
 
-        guard let results else {
+        self.dataSource = NCCollectionViewDataSource(metadatas: metadatas, layoutForView: layoutForView)
+
+        if metadatas.isEmpty {
             return super.reloadDataSource()
         }
-        let metadatas = Array(results.freeze())
 
         self.dataSource.caching(metadatas: metadatas, dataSourceMetadatas: dataSourceMetadatas) { updated in
             if updated || self.isNumberOfItemsInAllSectionsNull || self.numberOfItemsInAllSections != metadatas.count {
@@ -201,7 +201,8 @@ class NCFiles: NCCollectionViewCommon {
                 return completion(nil, false, error)
             }
             /// Check change eTag or E2EE  or DataSource empty
-            let tableDirectory = self.database.setDirectory(serverUrl: self.serverUrl, richWorkspace: metadata.richWorkspace, account: account)
+            self.database.updateDirectoryRichWorkspace(metadata.richWorkspace, account: account, serverUrl: self.serverUrl)
+            let tableDirectory = self.database.getTableDirectory(ocId: metadata.ocId)
             guard tableDirectory?.etag != metadata.etag || metadata.e2eEncrypted || self.dataSource.isEmpty() else {
                 return completion(nil, false, NKError())
             }

+ 6 - 4
iOSClient/Groupfolders/NCGroupfolders.swift

@@ -56,15 +56,17 @@ class NCGroupfolders: NCCollectionViewCommon {
     // MARK: - DataSource
 
     override func reloadDataSource() {
-        var results: Results<tableMetadata>?
+        var metadatas: [tableMetadata] = []
 
         if self.serverUrl.isEmpty {
-            results = database.getResultsMetadatasFromGroupfolders(session: session)
+            if let results = database.getResultsMetadatasFromGroupfolders(session: session) {
+                metadatas = Array(results.freeze())
+            }
         } else {
-            results = self.database.getResultsMetadatasPredicate(self.defaultPredicate, layoutForView: layoutForView)
+            metadatas = self.database.getResultsMetadatasPredicate(self.defaultPredicate, layoutForView: layoutForView)
         }
 
-        self.dataSource = NCCollectionViewDataSource(results: results, layoutForView: layoutForView)
+        self.dataSource = NCCollectionViewDataSource(metadatas: metadatas, layoutForView: layoutForView)
 
         super.reloadDataSource()
     }

+ 7 - 6
iOSClient/Main/Collection Common/NCCollectionViewCommon.swift

@@ -1073,7 +1073,7 @@ class NCCollectionViewCommon: UIViewController, UIGestureRecognizerDelegate, UIS
             } providers: { _, searchProviders in
                 self.providers = searchProviders
                 self.searchResults = []
-                self.dataSource = NCCollectionViewDataSource(results: nil, layoutForView: self.layoutForView, providers: self.providers, searchResults: self.searchResults)
+                self.dataSource = NCCollectionViewDataSource(metadatas: [], layoutForView: self.layoutForView, providers: self.providers, searchResults: self.searchResults)
             } update: { _, _, searchResult, metadatas in
                 guard let metadatas, !metadatas.isEmpty, self.isSearchingMode, let searchResult else { return }
                 NCNetworking.shared.unifiedSearchQueue.addOperation(NCCollectionViewUnifiedSearch(collectionViewCommon: self, metadatas: metadatas, searchResult: searchResult))
@@ -1085,16 +1085,17 @@ class NCCollectionViewCommon: UIViewController, UIGestureRecognizerDelegate, UIS
             NCNetworking.shared.searchFiles(literal: literalSearch, account: session.account) { task in
                 self.dataSourceTask = task
                 self.reloadDataSource()
-            } completion: { metadatas, error in
+            } completion: { metadatasSearch, error in
                 DispatchQueue.main.async {
                     self.refreshControl.endRefreshing()
                     self.reloadDataSource()
                 }
-                guard let metadatas, error == .success, self.isSearchingMode else { return }
-                let ocId = metadatas.map { $0.ocId }
-                let results = self.database.getResultsMetadatasPredicate(NSPredicate(format: "ocId IN %@", ocId), layoutForView: self.layoutForView)
+                guard let metadatasSearch, error == .success, self.isSearchingMode else { return }
+                let ocId = metadatasSearch.map { $0.ocId }
 
-                self.dataSource = NCCollectionViewDataSource(results: results, layoutForView: self.layoutForView, providers: self.providers, searchResults: self.searchResults)
+                let metadatas = self.database.getResultsMetadatasPredicate(NSPredicate(format: "ocId IN %@", ocId), layoutForView: self.layoutForView)
+
+                self.dataSource = NCCollectionViewDataSource(metadatas: metadatas, layoutForView: self.layoutForView, providers: self.providers, searchResults: self.searchResults)
             }
         }
     }

+ 2 - 10
iOSClient/Main/Collection Common/NCCollectionViewDataSource.swift

@@ -32,7 +32,6 @@ class NCCollectionViewDataSource: NSObject {
     private var sectionsValue: [String] = []
     private var providers: [NKSearchProvider]?
     private var searchResults: [NKSearchResult]?
-    private var results: Results<tableMetadata>?
     private var metadatas: [tableMetadata] = []
     private var metadatasForSection: [NCMetadataForSection] = []
     private var layoutForView: NCDBLayoutForView?
@@ -40,20 +39,14 @@ class NCCollectionViewDataSource: NSObject {
 
     override init() { super.init() }
 
-    init(results: Results<tableMetadata>?,
+    init(metadatas: [tableMetadata],
          layoutForView: NCDBLayoutForView? = nil,
          providers: [NKSearchProvider]? = nil,
          searchResults: [NKSearchResult]? = nil) {
         super.init()
         removeAll()
 
-        self.results = results
-        if let results {
-            self.metadatas = Array(results.freeze())
-        } else {
-            self.metadatas = []
-        }
-
+        self.metadatas = metadatas
         self.layoutForView = layoutForView
         /// unified search
         self.providers = providers
@@ -69,7 +62,6 @@ class NCCollectionViewDataSource: NSObject {
     func removeAll() {
         self.metadatas.removeAll()
         self.metadataIndexPath.removeAll()
-        self.results = nil
 
         self.metadatasForSection.removeAll()
         self.sectionsValue.removeAll()

+ 3 - 2
iOSClient/Menu/NCCollectionViewCommon+Menu.swift

@@ -36,6 +36,8 @@ extension NCCollectionViewCommon {
               let sceneIdentifier = self.controller?.sceneIdentifier else {
             return
         }
+        let tableLocalFile = database.getResultsTableLocalFile(predicate: NSPredicate(format: "ocId == %@", metadata.ocId))?.first
+        let fileExists = NCUtilityFileSystem().fileProviderStorageExists(metadata)
         var actions = [NCMenuAction]()
         let serverUrl = metadata.serverUrl + "/" + metadata.fileName
         var isOffline: Bool = false
@@ -230,8 +232,7 @@ extension NCCollectionViewCommon {
         //
         // SHARE
         //
-        if NCNetworking.shared.isOnline,
-           metadata.canShare {
+        if (NCNetworking.shared.isOnline || (tableLocalFile != nil && fileExists)) && metadata.canShare {
             actions.append(.share(selectedMetadatas: [metadata], controller: self.controller, order: 80))
         }
 

+ 3 - 0
iOSClient/NCGlobal.swift

@@ -337,6 +337,9 @@ class NCGlobal: NSObject {
     let notificationCenterEnableSwipeGesture                    = "enableSwipeGesture"
     let notificationCenterDisableSwipeGesture                   = "disableSwipeGesture"
 
+    let notificationCenterPlayerIsPlaying                       = "playerIsPlaying"
+    let notificationCenterPlayerStoppedPlaying                  = "playerStoppedPlaying"
+
     // TIP
     //
     let tipNCViewerPDFThumbnail                                 = "tipncviewerpdfthumbnail"

+ 8 - 0
iOSClient/Networking/E2EE/NCEndToEndMetadataV20.swift

@@ -291,6 +291,13 @@ extension NCEndToEndMetadata {
 
             // SIGNATURE CHECK
             //
+            if let signature {
+                if !verifySignature(account: session.account, signature: signature, userId: tableUser.userId, metadata: metadata, users: users, version: version, certificate: tableUser.certificate) {
+                    return NKError(errorCode: NCGlobal.shared.errorE2EEKeyVerifySignature, errorDescription: "_e2e_error_")
+                }
+            }
+
+            /*
             if let signature, !signature.isEmpty {
                 if !verifySignature(account: session.account, signature: signature, userId: tableUser.userId, metadata: metadata, users: users, version: version, certificate: tableUser.certificate) {
                     return NKError(errorCode: NCGlobal.shared.errorE2EEKeyVerifySignature, errorDescription: "_e2e_error_")
@@ -298,6 +305,7 @@ extension NCEndToEndMetadata {
             } else {
                 return NKError(errorCode: NCGlobal.shared.errorE2EEKeyVerifySignature, errorDescription: "_e2e_error_")
             }
+            */
 
             // FILEDROP
             //

+ 1 - 1
iOSClient/Networking/E2EE/NCNetworkingE2EEMarkFolder.swift

@@ -37,7 +37,7 @@ class NCNetworkingE2EEMarkFolder: NSObject {
         guard resultsMarkE2EEFolder.error == .success else { return resultsMarkE2EEFolder.error }
 
         file.e2eEncrypted = true
-        guard let metadata = self.database.addMetadata(self.database.convertFileToMetadata(file, isDirectoryE2EE: false)) else {
+        guard let metadata = self.database.createMetadata(self.database.convertFileToMetadata(file, isDirectoryE2EE: false)) else {
             return NKError(errorCode: NCGlobal.shared.errorUnexpectedResponseFromDB, errorDescription: "_e2e_error_")
         }
         self.database.addDirectory(e2eEncrypted: true, favorite: metadata.favorite, ocId: metadata.ocId, fileId: metadata.fileId, permissions: metadata.permissions, serverUrl: serverUrlFileName, account: metadata.account)

+ 11 - 12
iOSClient/Networking/E2EE/NCNetworkingE2EEUpload.swift

@@ -54,7 +54,7 @@ class NCNetworkingE2EEUpload: NSObject {
         }
         metadata.session = NCNetworking.shared.sessionUpload
         metadata.sessionError = ""
-        guard let result = self.database.addMetadata(metadata),
+        guard let result = self.database.createMetadata(metadata),
               let directory = self.database.getTableDirectory(predicate: NSPredicate(format: "account == %@ AND serverUrl == %@", metadata.account, metadata.serverUrl)) else {
             return NKError(errorCode: NCGlobal.shared.errorUnexpectedResponseFromDB, errorDescription: NSLocalizedString("_e2e_error_", comment: ""))
         }
@@ -121,17 +121,16 @@ class NCNetworkingE2EEUpload: NSObject {
         let resultsLock = await networkingE2EE.lock(account: metadata.account, serverUrl: metadata.serverUrl)
         guard let e2eToken = resultsLock.e2eToken, let fileId = resultsLock.fileId, resultsLock.error == .success else {
             self.database.deleteMetadata(predicate: NSPredicate(format: "ocIdTransfer == %@", metadata.ocIdTransfer))
-            NotificationCenter.default.postOnMainThread(
-                name: NCGlobal.shared.notificationCenterUploadedFile,
-                object: nil,
-                userInfo: ["ocId": metadata.ocId,
-                           "ocIdTransfer": metadata.ocIdTransfer,
-                           "session": metadata.session,
-                           "serverUrl": metadata.serverUrl,
-                           "account": metadata.account,
-                           "fileName": metadata.fileName,
-                           "error": NKError(errorCode: NCGlobal.shared.errorE2EELock, errorDescription: NSLocalizedString("_e2e_error_", comment: ""))],
-                second: 0.5)
+            NotificationCenter.default.postOnMainThread(name: NCGlobal.shared.notificationCenterUploadedFile,
+                                                        object: nil,
+                                                        userInfo: ["ocId": metadata.ocId,
+                                                                   "ocIdTransfer": metadata.ocIdTransfer,
+                                                                   "session": metadata.session,
+                                                                   "serverUrl": metadata.serverUrl,
+                                                                   "account": metadata.account,
+                                                                   "fileName": metadata.fileName,
+                                                                   "error": NKError(errorCode: NCGlobal.shared.errorE2EELock, errorDescription: NSLocalizedString("_e2e_error_", comment: ""))],
+                                                        second: 0.5)
             return NKError(errorCode: NCGlobal.shared.errorE2EELock, errorDescription: NSLocalizedString("_e2e_error_", comment: ""))
         }
 

+ 6 - 2
iOSClient/Networking/NCAutoUpload.swift

@@ -246,12 +246,16 @@ class NCAutoUpload: NSObject {
                     }
                     let idAsset = account + asset.localIdentifier + creationDateString
                     if !idAssets.contains(idAsset) {
-                        newAssets.append(asset)
+                        if (asset.isFavorite && tableAccount.autoUploadFavoritesOnly) || !tableAccount.autoUploadFavoritesOnly {
+                            newAssets.append(asset)
+                        }
                     }
                 }
             } else {
                 assets.enumerateObjects { asset, _, _ in
-                    newAssets.append(asset)
+                    if (asset.isFavorite && tableAccount.autoUploadFavoritesOnly) || !tableAccount.autoUploadFavoritesOnly {
+                        newAssets.append(asset)
+                    }
                 }
             }
             completion(newAssets)

+ 37 - 20
iOSClient/Networking/NCNetworkingProcess.swift

@@ -37,10 +37,21 @@ class NCNetworkingProcess {
     private var hasRun: Bool = false
     private let lockQueue = DispatchQueue(label: "com.nextcloud.networkingprocess.lockqueue")
     private var timerProcess: Timer?
+    private var enableControllingScreenAwake = true
 
     private init() {
         self.startTimer()
         self.startObserveTableMetadata()
+
+        NotificationCenter.default.addObserver(forName: NSNotification.Name(rawValue: NCGlobal.shared.notificationCenterPlayerIsPlaying), object: nil, queue: nil) { _ in
+
+            self.enableControllingScreenAwake = false
+        }
+
+        NotificationCenter.default.addObserver(forName: NSNotification.Name(rawValue: NCGlobal.shared.notificationCenterPlayerStoppedPlaying), object: nil, queue: nil) { _ in
+
+            self.enableControllingScreenAwake = true
+        }
     }
 
     private func startObserveTableMetadata() {
@@ -88,19 +99,19 @@ class NCNetworkingProcess {
 
                 /// Keep screen awake
                 ///
-                /*
                 Task {
                     let tasks = await self.networking.getAllDataTask()
                     let hasSynchronizationTask = tasks.contains { $0.taskDescription == NCGlobal.shared.taskDescriptionSynchronization }
                     let resultsTransfer = results.filter { self.global.metadataStatusInTransfer.contains($0.status) }
 
+                    if !self.enableControllingScreenAwake { return }
+
                     if resultsTransfer.isEmpty && !hasSynchronizationTask {
                         ScreenAwakeManager.shared.mode = .off
                     } else {
                         ScreenAwakeManager.shared.mode = NCKeychain().screenAwakeMode
                     }
                 }
-                */
 
                 if results.isEmpty {
 
@@ -297,15 +308,38 @@ class NCNetworkingProcess {
     private func metadataStatusWaitWebDav() async -> Bool {
         var returnValue: Bool = false
 
+        /// ------------------------ CREATE FOLDER
+        ///
+        if let metadatasWaitCreateFolder = self.database.getMetadatas(predicate: NSPredicate(format: "status == %d", global.metadataStatusWaitCreateFolder), sortedByKeyPath: "serverUrl", ascending: true), !metadatasWaitCreateFolder.isEmpty {
+            for metadata in metadatasWaitCreateFolder {
+                let error = await networking.createFolder(metadata: metadata)
+
+                if error != .success {
+                    if metadata.sessionError.isEmpty {
+                        let serverUrlFileName = metadata.serverUrl + "/" + metadata.fileName
+                        let message = String(format: NSLocalizedString("_create_folder_error_", comment: ""), serverUrlFileName)
+                        NCContentPresenter().messageNotification(message, error: error, delay: NCGlobal.shared.dismissAfterSecond, type: NCContentPresenter.messageType.error, priority: .max)
+                    }
+                    returnValue = true
+                }
+            }
+        }
+
         /// ------------------------ COPY
         ///
         if let metadatasWaitCopy = self.database.getMetadatas(predicate: NSPredicate(format: "status == %d", global.metadataStatusWaitCopy), sortedByKeyPath: "serverUrl", ascending: true), !metadatasWaitCopy.isEmpty {
             for metadata in metadatasWaitCopy {
                 let serverUrlTo = metadata.serverUrlTo
                 let serverUrlFileNameSource = metadata.serverUrl + "/" + metadata.fileName
-                let serverUrlFileNameDestination = serverUrlTo + "/" + metadata.fileName
+                var serverUrlFileNameDestination = serverUrlTo + "/" + metadata.fileName
                 let overwrite = (metadata.storeFlag as? NSString)?.boolValue ?? false
 
+                /// Within same folder
+                if metadata.serverUrl == serverUrlTo {
+                    let fileNameCopy = await NCNetworking.shared.createFileName(fileNameBase: metadata.fileName, account: metadata.account, serverUrl: metadata.serverUrl)
+                    serverUrlFileNameDestination = serverUrlTo + "/" + fileNameCopy
+                }
+
                 let result = await networking.copyFileOrFolder(serverUrlFileNameSource: serverUrlFileNameSource, serverUrlFileNameDestination: serverUrlFileNameDestination, overwrite: overwrite, account: metadata.account)
 
                 database.setMetadataCopyMove(ocId: metadata.ocId, serverUrlTo: "", overwrite: nil, status: global.metadataStatusNormal)
@@ -415,23 +449,6 @@ class NCNetworkingProcess {
             }
         }
 
-        /// ------------------------ CREATE FOLDER
-        ///
-        if let metadatasWaitCreateFolder = self.database.getMetadatas(predicate: NSPredicate(format: "status == %d", global.metadataStatusWaitCreateFolder), sortedByKeyPath: "serverUrl", ascending: true), !metadatasWaitCreateFolder.isEmpty {
-            for metadata in metadatasWaitCreateFolder {
-                let error = await networking.createFolder(metadata: metadata)
-
-                if error != .success {
-                    if metadata.sessionError.isEmpty {
-                        let serverUrlFileName = metadata.serverUrl + "/" + metadata.fileName
-                        let message = String(format: NSLocalizedString("_create_folder_error_", comment: ""), serverUrlFileName)
-                        NCContentPresenter().messageNotification(message, error: error, delay: NCGlobal.shared.dismissAfterSecond, type: NCContentPresenter.messageType.error, priority: .max)
-                    }
-                    returnValue = true
-                }
-            }
-        }
-
         return returnValue
     }
 

+ 1 - 5
iOSClient/Networking/NCService.swift

@@ -32,11 +32,7 @@ class NCService: NSObject {
     // MARK: -
 
     public func startRequestServicesServer(account: String, controller: NCMainTabBarController?) {
-        guard !account.isEmpty,
-              UIApplication.shared.applicationState != .background else {
-            NextcloudKit.shared.nkCommonInstance.writeLog("[INFO] Service not start request service server with the application in background")
-            return
-        }
+        guard !account.isEmpty, UIApplication.shared.applicationState == .active else { return }
 
         Task(priority: .background) {
             self.database.clearAllAvatarLoaded()

+ 6 - 4
iOSClient/Offline/NCOffline.swift

@@ -53,7 +53,7 @@ class NCOffline: NCCollectionViewCommon {
 
     override func reloadDataSource() {
         var ocIds: [String] = []
-        var results: Results<tableMetadata>?
+        var metadatas: [tableMetadata] = []
 
         if self.serverUrl.isEmpty {
             if let directories = self.database.getTablesDirectory(predicate: NSPredicate(format: "account == %@ AND offline == true", session.account), sorted: "serverUrl", ascending: true) {
@@ -65,12 +65,14 @@ class NCOffline: NCCollectionViewCommon {
             for file in files {
                 ocIds.append(file.ocId)
             }
-            results = self.database.getResultsMetadatas(predicate: NSPredicate(format: "account == %@ AND ocId IN %@", session.account, ocIds))
+            if let results = self.database.getResultsMetadatas(predicate: NSPredicate(format: "account == %@ AND ocId IN %@ AND NOT (status IN %@)", session.account, ocIds, global.metadataStatusHideInView)) {
+                metadatas = Array(results.freeze())
+            }
         } else {
-            results = self.database.getResultsMetadatasPredicate(self.defaultPredicate, layoutForView: layoutForView)
+            metadatas = self.database.getResultsMetadatasPredicate(self.defaultPredicate, layoutForView: layoutForView)
         }
 
-        self.dataSource = NCCollectionViewDataSource(results: results, layoutForView: layoutForView)
+        self.dataSource = NCCollectionViewDataSource(metadatas: metadatas, layoutForView: layoutForView)
 
         super.reloadDataSource()
     }

+ 6 - 2
iOSClient/Recent/NCRecent.swift

@@ -55,13 +55,17 @@ class NCRecent: NCCollectionViewCommon {
     // MARK: - DataSource
 
     override func reloadDataSource() {
-        let results = self.database.getResultsMetadatas(predicate: NSPredicate(format: "account == %@ AND fileName != '.'", session.account), sortedByKeyPath: "date", ascending: false)
+        var metadatas: [tableMetadata] = []
+
+        if let results = self.database.getResultsMetadatas(predicate: NSPredicate(format: "account == %@ AND fileName != '.'", session.account), sortedByKeyPath: "date", ascending: false) {
+            metadatas = Array(results.freeze())
+        }
 
         layoutForView?.sort = "date"
         layoutForView?.ascending = false
         layoutForView?.directoryOnTop = false
 
-        self.dataSource = NCCollectionViewDataSource(results: results, layoutForView: layoutForView)
+        self.dataSource = NCCollectionViewDataSource(metadatas: metadatas, layoutForView: layoutForView)
 
         super.reloadDataSource()
     }

+ 1 - 1
iOSClient/RichWorkspace/NCViewerRichWorkspace.swift

@@ -68,7 +68,7 @@ import MarkdownKit
         NCNetworking.shared.readFile(serverUrlFileName: self.serverUrl, account: session.account, queue: .main) { _ in
         } completion: { account, metadata, error in
             if error == .success, let metadata {
-                NCManageDatabase.shared.setDirectory(serverUrl: self.serverUrl, richWorkspace: metadata.richWorkspace, account: account)
+                NCManageDatabase.shared.updateDirectoryRichWorkspace(metadata.richWorkspace, account: account, serverUrl: self.serverUrl)
                 if self.richWorkspaceText != metadata.richWorkspace, metadata.richWorkspace != nil {
                     self.delegate?.richWorkspaceText = self.richWorkspaceText
                     self.richWorkspaceText = metadata.richWorkspace!

+ 4 - 2
iOSClient/SceneDelegate.swift

@@ -120,12 +120,14 @@ class SceneDelegate: UIResponder, UIWindowSceneDelegate {
 
         hidePrivacyProtectionWindow()
 
-        NCService().startRequestServicesServer(account: session.account, controller: controller)
-
         NCAutoUpload.shared.initAutoUpload(controller: nil, account: session.account) { num in
             NextcloudKit.shared.nkCommonInstance.writeLog("[INFO] Initialize Auto upload with \(num) uploads")
         }
 
+        DispatchQueue.main.asyncAfter(deadline: .now() + 1) {
+            NCService().startRequestServicesServer(account: session.account, controller: controller)
+        }
+
         DispatchQueue.main.asyncAfter(deadline: .now() + 2) {
             Task {
                 await NCNetworking.shared.verifyZombie()

+ 9 - 6
iOSClient/Select/NCSelect.swift

@@ -181,11 +181,14 @@ class NCSelect: UIViewController, UIGestureRecognizerDelegate, UIAdaptivePresent
         guard let userInfo = notification.userInfo as NSDictionary?,
               let ocId = userInfo["ocId"] as? String,
               let serverUrl = userInfo["serverUrl"] as? String,
+              let withPush = userInfo["withPush"] as? Bool,
               serverUrl == self.serverUrl,
               let metadata = self.database.getMetadataFromOcId(ocId)
         else { return }
 
-        pushMetadata(metadata)
+        if withPush {
+            pushMetadata(metadata)
+        }
     }
 
     // MARK: ACTION
@@ -466,9 +469,9 @@ extension NCSelect {
 
         if includeDirectoryE2EEncryption {
             if includeImages {
-                predicate = NSPredicate(format: "account == %@ AND serverUrl == %@ AND (directory == true OR classFile == 'image')", session.account, serverUrl)
+                predicate = NSPredicate(format: "account == %@ AND serverUrl == %@ AND (directory == true OR classFile == 'image') AND NOT (status IN %@)", session.account, serverUrl, NCGlobal.shared.metadataStatusHideInView)
             } else {
-                predicate = NSPredicate(format: "account == %@ AND serverUrl == %@ AND directory == true", session.account, serverUrl)
+                predicate = NSPredicate(format: "account == %@ AND serverUrl == %@ AND directory == true AND NOT (status IN %@)", session.account, serverUrl, NCGlobal.shared.metadataStatusHideInView)
             }
         } else {
             if includeImages {
@@ -476,7 +479,7 @@ extension NCSelect {
             } else if enableSelectFile {
                 predicate = NSPredicate(format: "account == %@ AND serverUrl == %@ AND e2eEncrypted == false AND NOT (status IN %@)", session.account, serverUrl, NCGlobal.shared.metadataStatusHideInView)
             } else {
-                predicate = NSPredicate(format: "account == %@ AND serverUrl == %@ AND e2eEncrypted == false AND directory == true", session.account, serverUrl)
+                predicate = NSPredicate(format: "account == %@ AND serverUrl == %@ AND e2eEncrypted == false AND directory == true AND NOT (status IN %@)", session.account, serverUrl, NCGlobal.shared.metadataStatusHideInView)
             }
         }
 
@@ -489,9 +492,9 @@ extension NCSelect {
                 self.collectionView.reloadData()
             }
         } completion: { _, _, _, _, _ in
-            let results = self.database.getResultsMetadatasPredicate(predicate, layoutForView: NCDBLayoutForView())
+            let metadatas = self.database.getResultsMetadatasPredicate(predicate, layoutForView: NCDBLayoutForView())
 
-            self.dataSource = NCCollectionViewDataSource(results: results)
+            self.dataSource = NCCollectionViewDataSource(metadatas: metadatas)
             self.collectionView.reloadData()
 
             NotificationCenter.default.postOnMainThread(name: NCGlobal.shared.notificationCenterReloadDataSource, userInfo: ["serverUrl": self.serverUrl])

+ 11 - 0
iOSClient/Settings/AutoUpload/NCAutoUploadModel.swift

@@ -41,6 +41,8 @@ class NCAutoUploadModel: ObservableObject, ViewOnAppearHandling {
     @Published var autoUploadVideo: Bool = false
     /// A state variable that indicates whether auto upload for videos is enabled or not
     @Published var autoUploadWWAnVideo: Bool = false
+    /// A state variable that indicates whether only assets marked as favorites should be uploaded
+    @Published var autoUploadFavoritesOnly: Bool = false
     /// A state variable that indicates whether auto upload for full resolution photos is enabled or not
     @Published var autoUploadFull: Bool = false
     /// A state variable that indicates whether auto upload creates subfolders based on date or not
@@ -78,6 +80,7 @@ class NCAutoUploadModel: ObservableObject, ViewOnAppearHandling {
             autoUploadWWAnPhoto = tableAccount.autoUploadWWAnPhoto
             autoUploadVideo = tableAccount.autoUploadVideo
             autoUploadWWAnVideo = tableAccount.autoUploadWWAnVideo
+            autoUploadFavoritesOnly = tableAccount.autoUploadFavoritesOnly
             autoUploadFull = tableAccount.autoUploadFull
             autoUploadCreateSubfolder = tableAccount.autoUploadCreateSubfolder
             autoUploadSubfolderGranularity = Granularity(rawValue: tableAccount.autoUploadSubfolderGranularity) ?? .monthly
@@ -152,6 +155,14 @@ class NCAutoUploadModel: ObservableObject, ViewOnAppearHandling {
         updateAccountProperty(\.autoUploadWWAnVideo, value: newValue)
     }
 
+    /// Updates the auto-upload favorite only.
+    func handleAutoUploadFavoritesOnlyChange(newValue: Bool) {
+        updateAccountProperty(\.autoUploadFavoritesOnly, value: newValue)
+        if newValue {
+            NCAutoUpload.shared.alignPhotoLibrary(controller: controller, account: session.account)
+        }
+    }
+
     /// Updates the auto-upload full content setting.
     func handleAutoUploadFullChange(newValue: Bool) {
         updateAccountProperty(\.autoUploadFull, value: newValue)

+ 9 - 0
iOSClient/Settings/AutoUpload/NCAutoUploadView.swift

@@ -113,6 +113,15 @@ struct NCAutoUploadView: View {
                 }
                 .font(.system(size: 16))
         })
+        /// Only upload favorites if desired
+        Section(content: {
+            Toggle(NSLocalizedString("_autoupload_favorites_", comment: ""), isOn: $model.autoUploadFavoritesOnly)
+                .tint(Color(NCBrandColor.shared.getElement(account: model.session.account)))
+                .onChange(of: model.autoUploadFavoritesOnly) { newValue in
+                    model.handleAutoUploadFavoritesOnlyChange(newValue: newValue)
+                }
+                .font(.system(size: 16))
+        })
         /// Auto Upload create subfolder
         Section(content: {
             Toggle(NSLocalizedString("_autoupload_create_subfolder_", comment: ""), isOn: $model.autoUploadCreateSubfolder)

+ 0 - 2
iOSClient/Settings/Display/NCDisplayView.swift

@@ -67,7 +67,6 @@ struct NCDisplayView: View {
             }
             .font(.system(size: 16))
 
-            /*
             Section(header: Text(NSLocalizedString("_additional_options_", comment: ""))) {
 
                 Picker(NSLocalizedString("_keep_screen_awake_", comment: ""),
@@ -79,7 +78,6 @@ struct NCDisplayView: View {
                        .frame(height: 50)
             }
             .pickerStyle(.menu)
-            */
         }
         .navigationBarTitle(NSLocalizedString("_display_", comment: ""))
         .defaultViewModifier(model)

+ 2 - 2
iOSClient/Shares/NCShares.swift

@@ -81,9 +81,9 @@ class NCShares: NCCollectionViewCommon {
             }
         }
 
-        let results = self.database.getResultsMetadatasPredicate(NSPredicate(format: "ocId IN %@", ocId), layoutForView: layoutForView)
+        let metadatas = self.database.getResultsMetadatasPredicate(NSPredicate(format: "ocId IN %@", ocId), layoutForView: layoutForView)
 
-        self.dataSource = NCCollectionViewDataSource(results: results, layoutForView: layoutForView)
+        self.dataSource = NCCollectionViewDataSource(metadatas: metadatas, layoutForView: layoutForView)
 
         super.reloadDataSource()
     }

BIN
iOSClient/Supporting Files/af.lproj/Localizable.strings


BIN
iOSClient/Supporting Files/an.lproj/Localizable.strings


BIN
iOSClient/Supporting Files/ar.lproj/InfoPlist.strings


BIN
iOSClient/Supporting Files/ar.lproj/Localizable.strings


BIN
iOSClient/Supporting Files/ast.lproj/Localizable.strings


BIN
iOSClient/Supporting Files/az.lproj/Localizable.strings


BIN
iOSClient/Supporting Files/be.lproj/Localizable.strings


BIN
iOSClient/Supporting Files/bg_BG.lproj/Localizable.strings


BIN
iOSClient/Supporting Files/bn_BD.lproj/Localizable.strings


BIN
iOSClient/Supporting Files/br.lproj/Localizable.strings


BIN
iOSClient/Supporting Files/bs.lproj/Localizable.strings


BIN
iOSClient/Supporting Files/ca.lproj/Localizable.strings


BIN
iOSClient/Supporting Files/cs-CZ.lproj/Localizable.strings


BIN
iOSClient/Supporting Files/cy_GB.lproj/Localizable.strings


BIN
iOSClient/Supporting Files/da.lproj/Localizable.strings


BIN
iOSClient/Supporting Files/de.lproj/Localizable.strings


BIN
iOSClient/Supporting Files/el.lproj/Localizable.strings


BIN
iOSClient/Supporting Files/en-GB.lproj/Localizable.strings


+ 2 - 1
iOSClient/Supporting Files/en.lproj/Localizable.strings

@@ -392,6 +392,7 @@
 "_autoupload_background_"           = "Auto upload in the background";
 "_autoupload_photos_"               = "Auto upload photos";
 "_autoupload_videos_"               = "Auto upload videos";
+"_autoupload_favorites_"            = "Auto upload favorites only";
 "_autoupload_description_"          = "New photos/videos will be automatically uploaded to your server.";
 "_autoupload_description_background_"  = "This option requires the use of GPS to trigger the detection of new photos/videos in the camera roll once the location changes significantly";
 "_autoupload_background_title_"     = "Limitations";
@@ -1007,7 +1008,7 @@
 "_additional_view_options_" = "Additional view options";
 "_while_charging_"          = "While charging";
 "_additional_options_"      = "Additional options";
-"_keep_screen_awake_"       = "Keep screen awake while transferring files";
+"_keep_screen_awake_"       = "Keep screen awake\nwhile transferring files";
 "_error_not_found_"         = "The requested resource could not be found";
 "_error_conflict_"          = "The request could not be completed due to a conflict with the current state of the resource";
 "_error_precondition_"      = "The server does not meet one of the preconditions that the requester";

BIN
iOSClient/Supporting Files/eo.lproj/Localizable.strings


BIN
iOSClient/Supporting Files/es-419.lproj/Localizable.strings


BIN
iOSClient/Supporting Files/es-AR.lproj/Localizable.strings


BIN
iOSClient/Supporting Files/es-CL.lproj/Localizable.strings


BIN
iOSClient/Supporting Files/es-CO.lproj/Localizable.strings


BIN
iOSClient/Supporting Files/es-CR.lproj/Localizable.strings


BIN
iOSClient/Supporting Files/es-DO.lproj/Localizable.strings


BIN
iOSClient/Supporting Files/es-EC.lproj/Localizable.strings


BIN
iOSClient/Supporting Files/es-GT.lproj/Localizable.strings


BIN
iOSClient/Supporting Files/es-HN.lproj/Localizable.strings


BIN
iOSClient/Supporting Files/es-MX.lproj/Localizable.strings


BIN
iOSClient/Supporting Files/es-NI.lproj/Localizable.strings


BIN
iOSClient/Supporting Files/es-PA.lproj/Localizable.strings


BIN
iOSClient/Supporting Files/es-PE.lproj/Localizable.strings


BIN
iOSClient/Supporting Files/es-PR.lproj/Localizable.strings


BIN
iOSClient/Supporting Files/es-PY.lproj/Localizable.strings


BIN
iOSClient/Supporting Files/es-SV.lproj/Localizable.strings


BIN
iOSClient/Supporting Files/es-UY.lproj/Localizable.strings


BIN
iOSClient/Supporting Files/es.lproj/Localizable.strings


BIN
iOSClient/Supporting Files/et_EE.lproj/Localizable.strings


BIN
iOSClient/Supporting Files/eu.lproj/Localizable.strings


BIN
iOSClient/Supporting Files/fa.lproj/Localizable.strings


BIN
iOSClient/Supporting Files/fi-FI.lproj/Localizable.strings


BIN
iOSClient/Supporting Files/fo.lproj/Localizable.strings


BIN
iOSClient/Supporting Files/fr.lproj/Localizable.strings


BIN
iOSClient/Supporting Files/ga.lproj/Localizable.strings


BIN
iOSClient/Supporting Files/gd.lproj/Localizable.strings


BIN
iOSClient/Supporting Files/gl.lproj/Localizable.strings


BIN
iOSClient/Supporting Files/he.lproj/Localizable.strings


BIN
iOSClient/Supporting Files/hi_IN.lproj/Localizable.strings


BIN
iOSClient/Supporting Files/hr.lproj/Localizable.strings


BIN
iOSClient/Supporting Files/hsb.lproj/Localizable.strings


BIN
iOSClient/Supporting Files/hu.lproj/Localizable.strings


BIN
iOSClient/Supporting Files/hy.lproj/Localizable.strings


BIN
iOSClient/Supporting Files/ia.lproj/Localizable.strings


BIN
iOSClient/Supporting Files/id.lproj/Localizable.strings


BIN
iOSClient/Supporting Files/ig.lproj/Localizable.strings


BIN
iOSClient/Supporting Files/is.lproj/Localizable.strings


BIN
iOSClient/Supporting Files/it.lproj/Localizable.strings


BIN
iOSClient/Supporting Files/ja-JP.lproj/Localizable.strings


BIN
iOSClient/Supporting Files/ka-GE.lproj/Localizable.strings


BIN
iOSClient/Supporting Files/ka.lproj/Localizable.strings


BIN
iOSClient/Supporting Files/kab.lproj/Localizable.strings


BIN
iOSClient/Supporting Files/km.lproj/Localizable.strings


BIN
iOSClient/Supporting Files/kn.lproj/Localizable.strings


BIN
iOSClient/Supporting Files/ko.lproj/Localizable.strings


BIN
iOSClient/Supporting Files/la.lproj/Localizable.strings


BIN
iOSClient/Supporting Files/lb.lproj/Localizable.strings


BIN
iOSClient/Supporting Files/lo.lproj/Localizable.strings


BIN
iOSClient/Supporting Files/lt_LT.lproj/Localizable.strings


BIN
iOSClient/Supporting Files/lv.lproj/Localizable.strings


BIN
iOSClient/Supporting Files/mk.lproj/Localizable.strings


Some files were not shown because too many files changed in this diff