Bladeren bron

Merge branch 'develop'

marinofaggiana 3 jaren geleden
bovenliggende
commit
7ebc212548
100 gewijzigde bestanden met toevoegingen van 241 en 102 verwijderingen
  1. 17 17
      Nextcloud.xcodeproj/project.pbxproj
  2. 4 4
      Nextcloud.xcodeproj/project.xcworkspace/xcshareddata/swiftpm/Package.resolved
  3. 1 1
      Share/NCShareExtension.swift
  4. 20 6
      iOSClient/AppDelegate.swift
  5. 8 6
      iOSClient/Data/NCManageDatabase.swift
  6. 2 2
      iOSClient/Favorites/NCFavorite.swift
  7. 1 1
      iOSClient/FileViewInFolder/NCFileViewInFolder.swift
  8. 2 2
      iOSClient/Files/NCFiles.swift
  9. 23 9
      iOSClient/Main/AudioRecorder/NCAudioRecorderViewController.swift
  10. 9 8
      iOSClient/Main/Collection Common/NCCollectionViewCommon.swift
  11. 33 15
      iOSClient/Main/Create cloud/NCCreateFormUploadVoiceNote.swift
  12. 1 3
      iOSClient/Media/NCMedia.swift
  13. 12 1
      iOSClient/More/NCMore.swift
  14. 4 1
      iOSClient/NCGlobal.swift
  15. 13 16
      iOSClient/Networking/NCNetworking.swift
  16. 2 2
      iOSClient/Offline/NCOffline.swift
  17. 1 1
      iOSClient/Select/NCSelect.swift
  18. 78 4
      iOSClient/Settings/CCAdvanced.m
  19. BIN
      iOSClient/Supporting Files/af.lproj/Localizable.strings
  20. BIN
      iOSClient/Supporting Files/ar.lproj/Localizable.strings
  21. BIN
      iOSClient/Supporting Files/ast.lproj/Localizable.strings
  22. BIN
      iOSClient/Supporting Files/az.lproj/Localizable.strings
  23. BIN
      iOSClient/Supporting Files/be.lproj/Localizable.strings
  24. BIN
      iOSClient/Supporting Files/bg_BG.lproj/Localizable.strings
  25. BIN
      iOSClient/Supporting Files/bn_BD.lproj/Localizable.strings
  26. BIN
      iOSClient/Supporting Files/br.lproj/Localizable.strings
  27. BIN
      iOSClient/Supporting Files/bs.lproj/Localizable.strings
  28. BIN
      iOSClient/Supporting Files/ca.lproj/Localizable.strings
  29. BIN
      iOSClient/Supporting Files/cs-CZ.lproj/Localizable.strings
  30. BIN
      iOSClient/Supporting Files/cy_GB.lproj/Localizable.strings
  31. BIN
      iOSClient/Supporting Files/da.lproj/Localizable.strings
  32. BIN
      iOSClient/Supporting Files/de.lproj/Localizable.strings
  33. BIN
      iOSClient/Supporting Files/el.lproj/Localizable.strings
  34. BIN
      iOSClient/Supporting Files/en-GB.lproj/Localizable.strings
  35. 10 3
      iOSClient/Supporting Files/en.lproj/Localizable.strings
  36. BIN
      iOSClient/Supporting Files/eo.lproj/Localizable.strings
  37. BIN
      iOSClient/Supporting Files/es-419.lproj/Localizable.strings
  38. BIN
      iOSClient/Supporting Files/es-AR.lproj/Localizable.strings
  39. BIN
      iOSClient/Supporting Files/es-CL.lproj/Localizable.strings
  40. BIN
      iOSClient/Supporting Files/es-CO.lproj/Localizable.strings
  41. BIN
      iOSClient/Supporting Files/es-CR.lproj/Localizable.strings
  42. BIN
      iOSClient/Supporting Files/es-DO.lproj/Localizable.strings
  43. BIN
      iOSClient/Supporting Files/es-EC.lproj/Localizable.strings
  44. BIN
      iOSClient/Supporting Files/es-GT.lproj/Localizable.strings
  45. BIN
      iOSClient/Supporting Files/es-HN.lproj/Localizable.strings
  46. BIN
      iOSClient/Supporting Files/es-MX.lproj/Localizable.strings
  47. BIN
      iOSClient/Supporting Files/es-NI.lproj/Localizable.strings
  48. BIN
      iOSClient/Supporting Files/es-PA.lproj/Localizable.strings
  49. BIN
      iOSClient/Supporting Files/es-PE.lproj/Localizable.strings
  50. BIN
      iOSClient/Supporting Files/es-PR.lproj/Localizable.strings
  51. BIN
      iOSClient/Supporting Files/es-PY.lproj/Localizable.strings
  52. BIN
      iOSClient/Supporting Files/es-SV.lproj/Localizable.strings
  53. BIN
      iOSClient/Supporting Files/es-UY.lproj/Localizable.strings
  54. BIN
      iOSClient/Supporting Files/es.lproj/Localizable.strings
  55. BIN
      iOSClient/Supporting Files/et_EE.lproj/Localizable.strings
  56. BIN
      iOSClient/Supporting Files/eu.lproj/Localizable.strings
  57. BIN
      iOSClient/Supporting Files/fa.lproj/Localizable.strings
  58. BIN
      iOSClient/Supporting Files/fi-FI.lproj/Localizable.strings
  59. BIN
      iOSClient/Supporting Files/fr.lproj/Localizable.strings
  60. BIN
      iOSClient/Supporting Files/gl.lproj/Localizable.strings
  61. BIN
      iOSClient/Supporting Files/he.lproj/Localizable.strings
  62. BIN
      iOSClient/Supporting Files/hr.lproj/Localizable.strings
  63. BIN
      iOSClient/Supporting Files/hu.lproj/Localizable.strings
  64. BIN
      iOSClient/Supporting Files/hy.lproj/Localizable.strings
  65. BIN
      iOSClient/Supporting Files/ia.lproj/Localizable.strings
  66. BIN
      iOSClient/Supporting Files/id.lproj/Localizable.strings
  67. BIN
      iOSClient/Supporting Files/is.lproj/Localizable.strings
  68. BIN
      iOSClient/Supporting Files/it.lproj/Localizable.strings
  69. BIN
      iOSClient/Supporting Files/ja-JP.lproj/Localizable.strings
  70. BIN
      iOSClient/Supporting Files/ka-GE.lproj/Localizable.strings
  71. BIN
      iOSClient/Supporting Files/km.lproj/Localizable.strings
  72. BIN
      iOSClient/Supporting Files/kn.lproj/Localizable.strings
  73. BIN
      iOSClient/Supporting Files/ko.lproj/Localizable.strings
  74. BIN
      iOSClient/Supporting Files/lb.lproj/Localizable.strings
  75. BIN
      iOSClient/Supporting Files/lo.lproj/Localizable.strings
  76. BIN
      iOSClient/Supporting Files/lt_LT.lproj/Localizable.strings
  77. BIN
      iOSClient/Supporting Files/lv.lproj/Localizable.strings
  78. BIN
      iOSClient/Supporting Files/mk.lproj/Localizable.strings
  79. BIN
      iOSClient/Supporting Files/mn.lproj/Localizable.strings
  80. BIN
      iOSClient/Supporting Files/ms_MY.lproj/Localizable.strings
  81. BIN
      iOSClient/Supporting Files/nb-NO.lproj/Localizable.strings
  82. BIN
      iOSClient/Supporting Files/nl.lproj/Localizable.strings
  83. BIN
      iOSClient/Supporting Files/nn_NO.lproj/Localizable.strings
  84. BIN
      iOSClient/Supporting Files/oc.lproj/Localizable.strings
  85. BIN
      iOSClient/Supporting Files/pl.lproj/Localizable.strings
  86. BIN
      iOSClient/Supporting Files/pt-BR.lproj/Localizable.strings
  87. BIN
      iOSClient/Supporting Files/pt-PT.lproj/Localizable.strings
  88. BIN
      iOSClient/Supporting Files/ro.lproj/Localizable.strings
  89. BIN
      iOSClient/Supporting Files/ru.lproj/Localizable.strings
  90. BIN
      iOSClient/Supporting Files/sc.lproj/Localizable.strings
  91. BIN
      iOSClient/Supporting Files/si.lproj/Localizable.strings
  92. BIN
      iOSClient/Supporting Files/sk-SK.lproj/Localizable.strings
  93. BIN
      iOSClient/Supporting Files/sl.lproj/Localizable.strings
  94. BIN
      iOSClient/Supporting Files/sq.lproj/Localizable.strings
  95. BIN
      iOSClient/Supporting Files/sr.lproj/Localizable.strings
  96. BIN
      iOSClient/Supporting Files/sr@latin.lproj/Localizable.strings
  97. BIN
      iOSClient/Supporting Files/sv.lproj/Localizable.strings
  98. BIN
      iOSClient/Supporting Files/ta.lproj/Localizable.strings
  99. BIN
      iOSClient/Supporting Files/th_TH.lproj/Localizable.strings
  100. BIN
      iOSClient/Supporting Files/tr.lproj/Localizable.strings

+ 17 - 17
Nextcloud.xcodeproj/project.pbxproj

@@ -2307,7 +2307,7 @@
 				CODE_SIGN_IDENTITY = "iPhone Developer";
 				"CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer";
 				CODE_SIGN_STYLE = Automatic;
-				CURRENT_PROJECT_VERSION = 1;
+				CURRENT_PROJECT_VERSION = 2;
 				DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym";
 				DEVELOPMENT_TEAM = 6JLRKY9ZV7;
 				FRAMEWORK_SEARCH_PATHS = "$(inherited)";
@@ -2327,7 +2327,7 @@
 					"@executable_path/../../Frameworks",
 				);
 				LIBRARY_SEARCH_PATHS = "";
-				MARKETING_VERSION = 4.0.1;
+				MARKETING_VERSION = 4.0.2;
 				MTL_ENABLE_DEBUG_INFO = INCLUDE_SOURCE;
 				MTL_FAST_MATH = YES;
 				OTHER_LDFLAGS = "-ObjC";
@@ -2360,7 +2360,7 @@
 				CODE_SIGN_IDENTITY = "iPhone Developer";
 				"CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer";
 				CODE_SIGN_STYLE = Automatic;
-				CURRENT_PROJECT_VERSION = 1;
+				CURRENT_PROJECT_VERSION = 2;
 				DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym";
 				DEVELOPMENT_TEAM = 6JLRKY9ZV7;
 				FRAMEWORK_SEARCH_PATHS = "$(inherited)";
@@ -2380,7 +2380,7 @@
 					"@executable_path/../../Frameworks",
 				);
 				LIBRARY_SEARCH_PATHS = "";
-				MARKETING_VERSION = 4.0.1;
+				MARKETING_VERSION = 4.0.2;
 				MTL_FAST_MATH = YES;
 				OTHER_LDFLAGS = "-ObjC";
 				PRODUCT_BUNDLE_IDENTIFIER = "it.twsweb.Nextcloud.Notification-Service-Extension";
@@ -2404,7 +2404,7 @@
 				CODE_SIGN_ENTITLEMENTS = iOSClient/Brand/Share.entitlements;
 				CODE_SIGN_IDENTITY = "iPhone Developer";
 				"CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer";
-				CURRENT_PROJECT_VERSION = 1;
+				CURRENT_PROJECT_VERSION = 2;
 				DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym";
 				DEVELOPMENT_TEAM = 6JLRKY9ZV7;
 				FRAMEWORK_SEARCH_PATHS = "$(inherited)";
@@ -2424,7 +2424,7 @@
 					"@executable_path/../../Frameworks",
 				);
 				LIBRARY_SEARCH_PATHS = "";
-				MARKETING_VERSION = 4.0.1;
+				MARKETING_VERSION = 4.0.2;
 				OTHER_LDFLAGS = "-ObjC";
 				PRODUCT_BUNDLE_IDENTIFIER = it.twsweb.Nextcloud.Share;
 				PRODUCT_NAME = "$(TARGET_NAME)";
@@ -2449,7 +2449,7 @@
 				CODE_SIGN_ENTITLEMENTS = iOSClient/Brand/Share.entitlements;
 				CODE_SIGN_IDENTITY = "iPhone Developer";
 				"CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer";
-				CURRENT_PROJECT_VERSION = 1;
+				CURRENT_PROJECT_VERSION = 2;
 				DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym";
 				DEVELOPMENT_TEAM = 6JLRKY9ZV7;
 				FRAMEWORK_SEARCH_PATHS = "$(inherited)";
@@ -2469,7 +2469,7 @@
 					"@executable_path/../../Frameworks",
 				);
 				LIBRARY_SEARCH_PATHS = "";
-				MARKETING_VERSION = 4.0.1;
+				MARKETING_VERSION = 4.0.2;
 				OTHER_LDFLAGS = "-ObjC";
 				PRODUCT_BUNDLE_IDENTIFIER = it.twsweb.Nextcloud.Share;
 				PRODUCT_NAME = "$(TARGET_NAME)";
@@ -2501,7 +2501,7 @@
 				CODE_SIGN_IDENTITY = "iPhone Developer";
 				"CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer";
 				CODE_SIGN_STYLE = Automatic;
-				CURRENT_PROJECT_VERSION = 1;
+				CURRENT_PROJECT_VERSION = 2;
 				DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym";
 				DEVELOPMENT_TEAM = 6JLRKY9ZV7;
 				FRAMEWORK_SEARCH_PATHS = "$(inherited)";
@@ -2521,7 +2521,7 @@
 					"@executable_path/../../Frameworks",
 				);
 				LIBRARY_SEARCH_PATHS = "";
-				MARKETING_VERSION = 4.0.1;
+				MARKETING_VERSION = 4.0.2;
 				OTHER_LDFLAGS = "-ObjC";
 				PRODUCT_BUNDLE_IDENTIFIER = "it.twsweb.Nextcloud.File-Provider-Extension";
 				PRODUCT_NAME = "$(TARGET_NAME)";
@@ -2553,7 +2553,7 @@
 				CODE_SIGN_IDENTITY = "iPhone Developer";
 				"CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer";
 				CODE_SIGN_STYLE = Automatic;
-				CURRENT_PROJECT_VERSION = 1;
+				CURRENT_PROJECT_VERSION = 2;
 				DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym";
 				DEVELOPMENT_TEAM = 6JLRKY9ZV7;
 				FRAMEWORK_SEARCH_PATHS = "$(inherited)";
@@ -2573,7 +2573,7 @@
 					"@executable_path/../../Frameworks",
 				);
 				LIBRARY_SEARCH_PATHS = "";
-				MARKETING_VERSION = 4.0.1;
+				MARKETING_VERSION = 4.0.2;
 				OTHER_LDFLAGS = "-ObjC";
 				PRODUCT_BUNDLE_IDENTIFIER = "it.twsweb.Nextcloud.File-Provider-Extension";
 				PRODUCT_NAME = "$(TARGET_NAME)";
@@ -2597,7 +2597,7 @@
 				CODE_SIGN_ENTITLEMENTS = iOSClient/Brand/iOSClient.entitlements;
 				CODE_SIGN_IDENTITY = "iPhone Developer";
 				"CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer";
-				CURRENT_PROJECT_VERSION = 1;
+				CURRENT_PROJECT_VERSION = 2;
 				DEVELOPMENT_TEAM = 6JLRKY9ZV7;
 				ENABLE_BITCODE = YES;
 				FRAMEWORK_SEARCH_PATHS = "$(inherited)";
@@ -2614,7 +2614,7 @@
 					"@executable_path/../../Frameworks",
 				);
 				LIBRARY_SEARCH_PATHS = "";
-				MARKETING_VERSION = 4.0.1;
+				MARKETING_VERSION = 4.0.2;
 				OTHER_LDFLAGS = "-ObjC";
 				OTHER_SWIFT_FLAGS = "";
 				PRODUCT_BUNDLE_IDENTIFIER = "it.twsweb.$(PRODUCT_NAME:rfc1034identifier)";
@@ -2644,7 +2644,7 @@
 				CODE_SIGN_IDENTITY = "iPhone Developer";
 				"CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer";
 				COPY_PHASE_STRIP = NO;
-				CURRENT_PROJECT_VERSION = 1;
+				CURRENT_PROJECT_VERSION = 2;
 				DEVELOPMENT_TEAM = 6JLRKY9ZV7;
 				ENABLE_BITCODE = YES;
 				FRAMEWORK_SEARCH_PATHS = "$(inherited)";
@@ -2660,7 +2660,7 @@
 					"@executable_path/../../Frameworks",
 				);
 				LIBRARY_SEARCH_PATHS = "";
-				MARKETING_VERSION = 4.0.1;
+				MARKETING_VERSION = 4.0.2;
 				OTHER_LDFLAGS = "-ObjC";
 				PRODUCT_BUNDLE_IDENTIFIER = "it.twsweb.$(PRODUCT_NAME:rfc1034identifier)";
 				PRODUCT_NAME = "$(TARGET_NAME)";
@@ -2897,7 +2897,7 @@
 			repositoryURL = "https://github.com/realm/realm-cocoa";
 			requirement = {
 				kind = exactVersion;
-				version = 10.7.6;
+				version = 10.8.1;
 			};
 		};
 		F786D58B253454BF00E3DD7B /* XCRemoteSwiftPackageReference "ios-communication-library" */ = {

+ 4 - 4
Nextcloud.xcodeproj/project.xcworkspace/xcshareddata/swiftpm/Package.resolved

@@ -177,8 +177,8 @@
         "repositoryURL": "https://github.com/realm/realm-cocoa",
         "state": {
           "branch": null,
-          "revision": "7e5c77fd7fbb30259e8e6e6a41f32289f72e0812",
-          "version": "10.7.6"
+          "revision": "827f9bf97f44e40fda8a750698f3e096734629ee",
+          "version": "10.8.1"
         }
       },
       {
@@ -186,8 +186,8 @@
         "repositoryURL": "https://github.com/realm/realm-core",
         "state": {
           "branch": null,
-          "revision": "018adb3469c2882904febca251778129ef4a9b70",
-          "version": "10.7.2"
+          "revision": "d85d071cc25b6f64fabbbebbaaae20f367ef64ae",
+          "version": "11.0.3"
         }
       },
       {

+ 1 - 1
Share/NCShareExtension.swift

@@ -715,7 +715,7 @@ extension NCShareExtension {
         networkInProgress = true
         collectionView.reloadData()
         
-        NCNetworking.shared.readFolder(serverUrl: serverUrl, account: activeAccount.account) { (_, metadataFolder, _, _, _, errorCode, errorDescription) in
+        NCNetworking.shared.readFolder(serverUrl: serverUrl, account: activeAccount.account) { (_, metadataFolder, _, _, _, _, errorCode, errorDescription) in
             if errorCode != 0 {
                 let alertController = UIAlertController(title: NSLocalizedString("_error_", comment: ""), message: errorDescription, preferredStyle: .alert)
                 alertController.addAction(UIAlertAction(title: NSLocalizedString("_ok_", comment: ""), style: .default, handler: { _ in }))

+ 20 - 6
iOSClient/AppDelegate.swift

@@ -50,6 +50,7 @@ class AppDelegate: UIResponder, UIApplicationDelegate, UNUserNotificationCenterD
     @objc var activeViewController: UIViewController?
     var activeViewerVideo: NCViewerVideo?
     var mainTabBar: NCMainTabBar?
+    var activeMetadata: tableMetadata?
     
     var listFilesVC: [String:NCFiles] = [:]
     var listFavoriteVC: [String:NCFavorite] = [:]
@@ -140,12 +141,7 @@ class AppDelegate: UIResponder, UIApplicationDelegate, UNUserNotificationCenterD
         UNUserNotificationCenter.current().requestAuthorization(options: [.alert, .badge, .sound]) { (_, _) in }
 
         // Audio Session
-        do {
-            try AVAudioSession.sharedInstance().setCategory(.playAndRecord, mode: .default, options: [.mixWithOthers, .allowAirPlay])
-            try AVAudioSession.sharedInstance().setActive(true)
-        } catch {
-            print(error)
-        }
+        setAVAudioSession()
         
         // Store review
         if !NCUtility.shared.isSimulatorOrTestFlight() {
@@ -252,6 +248,12 @@ class AppDelegate: UIResponder, UIApplicationDelegate, UNUserNotificationCenterD
                 self.activeFileViewInFolder = nil
             })
         }
+        
+        // Clear older files
+        let days = CCUtility.getCleanUpDay()
+        if let directory = CCUtility.getDirectoryProviderStorage() {
+            NCUtilityFileSystem.shared.cleanUp(directory: directory, days: TimeInterval(days))
+        }
     }
     
     // L' applicazione è entrata nello sfondo
@@ -314,6 +316,18 @@ class AppDelegate: UIResponder, UIApplicationDelegate, UNUserNotificationCenterD
         //[fileProviderDomain registerDomains];
     }
   
+    // MARK: - AVAudioSession
+    
+    func setAVAudioSession() {
+        do {
+            try AVAudioSession.sharedInstance().overrideOutputAudioPort(AVAudioSession.PortOverride.none)
+            try AVAudioSession.sharedInstance().setCategory(.playback, mode: .default, options: [.mixWithOthers, .allowAirPlay])
+            try AVAudioSession.sharedInstance().setActive(true)
+        } catch {
+            print(error)
+        }
+    }
+    
     // MARK: - Background Task
     
     @available(iOS 13.0, *)

+ 8 - 6
iOSClient/Data/NCManageDatabase.swift

@@ -2040,13 +2040,14 @@ class NCManageDatabase: NSObject {
     }
 
     @discardableResult
-    func updateMetadatas(_ metadatas: [tableMetadata], metadatasResult: [tableMetadata], addCompareLivePhoto: Bool = true, addExistsInLocal: Bool = false, addCompareEtagLocal: Bool = false, addDirectorySynchronized: Bool = false) -> (metadatasUpdate: [tableMetadata], metadatasLocalUpdate: [tableMetadata]) {
+    func updateMetadatas(_ metadatas: [tableMetadata], metadatasResult: [tableMetadata], addCompareLivePhoto: Bool = true, addExistsInLocal: Bool = false, addCompareEtagLocal: Bool = false, addDirectorySynchronized: Bool = false) -> (metadatasUpdate: [tableMetadata], metadatasLocalUpdate: [tableMetadata], metadatasDelete: [tableMetadata]) {
         
         let realm = try! Realm()
-        var ocIdsUdate : [String] = []
-        var ocIdsLocalUdate : [String] = []
-        var metadatasUpdate : [tableMetadata] = []
-        var metadatasLocalUpdate : [tableMetadata] = []
+        var ocIdsUdate: [String] = []
+        var ocIdsLocalUdate: [String] = []
+        var metadatasDelete: [tableMetadata] = []
+        var metadatasUpdate: [tableMetadata] = []
+        var metadatasLocalUpdate: [tableMetadata] = []
         
         realm.refresh()
         
@@ -2057,6 +2058,7 @@ class NCManageDatabase: NSObject {
                 for metadataResult in metadatasResult {
                     if metadatas.firstIndex(where: { $0.ocId == metadataResult.ocId }) == nil {
                         if let result = realm.objects(tableMetadata.self).filter(NSPredicate(format: "ocId == %@", metadataResult.ocId)).first {
+                            metadatasDelete.append(tableMetadata.init(value: result))
                             realm.delete(result)
                         }
                     }
@@ -2115,7 +2117,7 @@ class NCManageDatabase: NSObject {
             }
         }
         
-        return (metadatasUpdate, metadatasLocalUpdate)
+        return (metadatasUpdate, metadatasLocalUpdate, metadatasDelete)
     }
     
     func setMetadataSession(ocId: String, session: String? = nil, sessionError: String? = nil, sessionSelector: String? = nil, sessionTaskIdentifier: Int? = nil, status: Int? = nil, etag: String? = nil) {

+ 2 - 2
iOSClient/Favorites/NCFavorite.swift

@@ -89,7 +89,7 @@ class NCFavorite: NCCollectionViewCommon  {
             
         } else {
             
-            networkReadFolder(forced: forced) { (metadatas, metadatasUpdate, errorCode, errorDescription) in
+            networkReadFolder(forced: forced) { (metadatas, metadatasUpdate, metadatasDelete, errorCode, errorDescription) in
                 if errorCode == 0 {
                     for metadata in metadatas ?? [] {
                         if !metadata.directory {
@@ -102,7 +102,7 @@ class NCFavorite: NCCollectionViewCommon  {
                 
                 self.refreshControl.endRefreshing()
                 self.isReloadDataSourceNetworkInProgress = false
-                if metadatasUpdate?.count ?? 0 > 0 || forced {
+                if metadatasUpdate?.count ?? 0 > 0 || metadatasDelete?.count ?? 0 > 0 || forced {
                     self.reloadDataSource()
                 } else {
                     self.collectionView?.reloadData()

+ 1 - 1
iOSClient/FileViewInFolder/NCFileViewInFolder.swift

@@ -131,7 +131,7 @@ class NCFileViewInFolder: NCCollectionViewCommon  {
         isReloadDataSourceNetworkInProgress = true
         collectionView?.reloadData()
                
-        networkReadFolder(forced: forced) { (metadatas, metadatasUpdate, errorCode, errorDescription) in
+        networkReadFolder(forced: forced) { (metadatas, metadatasUpdate, metadatasDelete, errorCode, errorDescription) in
             if errorCode == 0 {
                 for metadata in metadatas ?? [] {
                     if !metadata.directory {

+ 2 - 2
iOSClient/Files/NCFiles.swift

@@ -97,7 +97,7 @@ class NCFiles: NCCollectionViewCommon  {
         isReloadDataSourceNetworkInProgress = true
         collectionView?.reloadData()
                
-        networkReadFolder(forced: forced) { (metadatas, metadatasUpdate, errorCode, errorDescription) in
+        networkReadFolder(forced: forced) { (metadatas, metadatasUpdate, metadatasDelete, errorCode, errorDescription) in
             if errorCode == 0 {
                 for metadata in metadatas ?? [] {
                     if !metadata.directory {
@@ -110,7 +110,7 @@ class NCFiles: NCCollectionViewCommon  {
             
             self.refreshControl.endRefreshing()
             self.isReloadDataSourceNetworkInProgress = false
-            if metadatasUpdate?.count ?? 0 > 0 || forced {
+            if metadatasUpdate?.count ?? 0 > 0 || metadatasDelete?.count ?? 0 > 0 || forced {
                 self.reloadDataSource()
             } else {
                 self.collectionView?.reloadData()

+ 23 - 9
iOSClient/Main/AudioRecorder/NCAudioRecorderViewController.swift

@@ -39,7 +39,8 @@ class NCAudioRecorderViewController: UIViewController , NCAudioRecorderDelegate
     var recording: NCAudioRecorder!
     var recordDuration: TimeInterval = 0
     var fileName: String = ""
-    
+    let appDelegate = UIApplication.shared.delegate as! AppDelegate
+
     @IBOutlet weak var contentContainerView: UIView!
     @IBOutlet weak var durationLabel: UILabel!
     @IBOutlet weak var startStopLabel: UILabel!
@@ -84,6 +85,7 @@ class NCAudioRecorderViewController: UIViewController , NCAudioRecorderDelegate
             startStop()
         } else {
             dismiss(animated: true) {
+                self.appDelegate.setAVAudioSession()
                 self.delegate?.didFinishWithoutRecording(self, fileName: self.fileName)
             }
         }
@@ -98,8 +100,10 @@ class NCAudioRecorderViewController: UIViewController , NCAudioRecorderDelegate
             voiceRecordHUD.update(0.0)
         
             dismiss(animated: true) {
+                self.appDelegate.setAVAudioSession()
                 self.delegate?.didFinishRecording(self, fileName: self.fileName)
             }
+            
         } else {
             
             recordDuration = 0
@@ -179,7 +183,7 @@ open class NCAudioRecorder : NSObject {
     var recorder: AVAudioRecorder?
     fileprivate var player: AVAudioPlayer?
     fileprivate var link: CADisplayLink?
-    
+
     var metering: Bool {
         return delegate?.responds(to: #selector(NCAudioRecorderDelegate.audioMeterDidUpdate(_:))) == true
     }
@@ -189,11 +193,20 @@ open class NCAudioRecorder : NSObject {
     public init(to: String) {
         url = URL(fileURLWithPath: NCAudioRecorder.directory).appendingPathComponent(to)
         super.init()
+        
+        do {
+            try session.setCategory(.playAndRecord, mode: .default)
+            try session.overrideOutputAudioPort(AVAudioSession.PortOverride.speaker)
+            try session.setActive(true)
+        } catch {
+            print(error)
+        }
     }
     
     // MARK: - Record
     
     open func prepare() throws {
+        
         let settings: [String: AnyObject] = [
             AVFormatIDKey : NSNumber(value: Int32(kAudioFormatAppleLossless) as Int32),
             AVEncoderAudioQualityKey: AVAudioQuality.max.rawValue as AnyObject,
@@ -209,21 +222,20 @@ open class NCAudioRecorder : NSObject {
     }
     
     open func record() throws {
+        
         if recorder == nil {
             try prepare()
         }
         
-        try session.overrideOutputAudioPort(AVAudioSession.PortOverride.speaker)
-
-        recorder?.record()
-        state = .record
-        
-        if metering {
-            startMetering()
+        self.state = .record
+        if self.metering {
+            self.startMetering()
         }
+        self.recorder?.record()
     }
     
     open func stop() {
+        
         switch state {
         case .play:
             player?.stop()
@@ -252,11 +264,13 @@ open class NCAudioRecorder : NSObject {
     }
     
     fileprivate func startMetering() {
+        
         link = CADisplayLink(target: self, selector: #selector(NCAudioRecorder.updateMeter))
         link?.add(to: RunLoop.current, forMode: RunLoop.Mode.common)
     }
     
     fileprivate func stopMetering() {
+        
         link?.invalidate()
         link = nil
     }

+ 9 - 8
iOSClient/Main/Collection Common/NCCollectionViewCommon.swift

@@ -1014,7 +1014,7 @@ class NCCollectionViewCommon: UIViewController, UIGestureRecognizerDelegate, UIS
         }
     }
     
-    @objc func networkReadFolder(forced: Bool, completion: @escaping(_ metadatas: [tableMetadata]?, _ metadatasUpdate: [tableMetadata]?, _ errorCode: Int, _ errorDescription: String)->()) {
+    @objc func networkReadFolder(forced: Bool, completion: @escaping(_ metadatas: [tableMetadata]?, _ metadatasUpdate: [tableMetadata]?, _ metadatasDelete: [tableMetadata]?, _ errorCode: Int, _ errorDescription: String)->()) {
         
         NCNetworking.shared.readFile(serverUrlFileName: serverUrl, account: appDelegate.account) { (account, metadata, errorCode, errorDescription) in
             
@@ -1024,7 +1024,7 @@ class NCCollectionViewCommon: UIViewController, UIGestureRecognizerDelegate, UIS
                 
                 if forced || directory?.etag != metadata?.etag || directory?.e2eEncrypted ?? false {
                     
-                    NCNetworking.shared.readFolder(serverUrl: self.serverUrl, account: self.appDelegate.account) { (account, metadataFolder, metadatas, metadatasUpdate, metadatasLocalUpdate, errorCode, errorDescription) in
+                    NCNetworking.shared.readFolder(serverUrl: self.serverUrl, account: self.appDelegate.account) { (account, metadataFolder, metadatas, metadatasUpdate, metadatasLocalUpdate, metadatasDelete, errorCode, errorDescription) in
                         
                         if errorCode == 0 {
                             self.metadataFolder = metadataFolder
@@ -1048,23 +1048,23 @@ class NCCollectionViewCommon: UIViewController, UIGestureRecognizerDelegate, UIS
                                             NCContentPresenter.shared.messageNotification("_error_e2ee_", description: "_e2e_error_decode_metadata_", delay: NCGlobal.shared.dismissAfterSecond, type: NCContentPresenter.messageType.error, errorCode: NCGlobal.shared.errorDecodeMetadata, forced: true)
                                         }
                                         
-                                        completion(metadatas, metadatasUpdate, errorCode, errorDescription)
+                                        completion(metadatas, metadatasUpdate, metadatasDelete, errorCode, errorDescription)
                                     }
                                 } else {
-                                    completion(metadatas, metadatasUpdate, errorCode, errorDescription)
+                                    completion(metadatas, metadatasUpdate, metadatasDelete, errorCode, errorDescription)
                                 }
                             } else {
-                                completion(metadatas, metadatasUpdate, errorCode, errorDescription)
+                                completion(metadatas, metadatasUpdate, metadatasDelete, errorCode, errorDescription)
                             }
                         } else {
-                            completion(nil, nil, errorCode, errorDescription)
+                            completion(nil, nil, nil, errorCode, errorDescription)
                         }
                     }
                 } else {
-                    completion(nil, nil, 0, "")
+                    completion(nil, nil, nil, 0, "")
                 }
             } else {
-               completion(nil, nil, errorCode, errorDescription)
+               completion(nil, nil, nil, errorCode, errorDescription)
             }
         }
     }
@@ -1079,6 +1079,7 @@ extension NCCollectionViewCommon: UICollectionViewDelegate {
         guard let metadata = dataSource.cellForItemAt(indexPath: indexPath) else { return }
         metadataTouch = metadata
         selectedIndexPath = indexPath
+        appDelegate.activeMetadata = metadata
         
         if isEditMode {
             if let index = selectOcId.firstIndex(of: metadata.ocId) {

+ 33 - 15
iOSClient/Main/Create cloud/NCCreateFormUploadVoiceNote.swift

@@ -80,6 +80,14 @@ class NCCreateFormUploadVoiceNote: XLFormViewController, NCSelectDelegate, AVAud
         updateTimerUI()
     }
     
+    override func viewDidDisappear(_ animated: Bool) {
+        super.viewDidDisappear(animated)
+        
+        if audioPlayer.isPlaying {
+            stop()
+        }
+    }
+    
     override func traitCollectionDidChange(_ previousTraitCollection: UITraitCollection?) {
         super.traitCollectionDidChange(previousTraitCollection)
         
@@ -311,27 +319,37 @@ class NCCreateFormUploadVoiceNote: XLFormViewController, NCSelectDelegate, AVAud
 
         if audioPlayer.isPlaying {
             
-            audioPlayer.currentTime = 0.0
-            audioPlayer.stop()
-            
-            timer.invalidate()
-            counterSecondPlayer = 0
-            progressView.progress = 0
-            updateTimerUI()
-            
-            buttonPlayStop.setImage(UIImage(named: "audioPlay")!.image(color: NCBrandColor.shared.gray, size: 100), for: .normal)
+            stop()
             
         } else {
             
-            audioPlayer.prepareToPlay()
-            audioPlayer.play()
-            
-            timer = Timer.scheduledTimer(timeInterval: 1, target: self, selector: #selector(updateTimer), userInfo: nil, repeats: true)
-            
-            buttonPlayStop.setImage(UIImage(named: "stop")!.image(color: NCBrandColor.shared.gray, size: 100), for: .normal)
+            start()
         }
     }
     
+    func start() {
+        
+        audioPlayer.prepareToPlay()
+        audioPlayer.play()
+        
+        timer = Timer.scheduledTimer(timeInterval: 1, target: self, selector: #selector(updateTimer), userInfo: nil, repeats: true)
+        
+        buttonPlayStop.setImage(UIImage(named: "stop")!.image(color: NCBrandColor.shared.gray, size: 100), for: .normal)
+    }
+    
+    func stop() {
+        
+        audioPlayer.currentTime = 0.0
+        audioPlayer.stop()
+        
+        timer.invalidate()
+        counterSecondPlayer = 0
+        progressView.progress = 0
+        updateTimerUI()
+        
+        buttonPlayStop.setImage(UIImage(named: "audioPlay")!.image(color: NCBrandColor.shared.gray, size: 100), for: .normal)
+    }
+    
     func audioPlayerDidFinishPlaying(_ player: AVAudioPlayer, successfully flag: Bool) {
         
         timer.invalidate()

+ 1 - 3
iOSClient/Media/NCMedia.swift

@@ -565,12 +565,10 @@ extension NCMedia {
             if errorCode == 0 && account == self.appDelegate.account {
                 if files.count > 0 {
                     NCManageDatabase.shared.convertNCCommunicationFilesToMetadatas(files, useMetadataFolder: false, account: self.appDelegate.account) { (_, _, metadatas) in
-                        
                         let predicateDate = NSPredicate(format: "date > %@ AND date < %@", greaterDate as NSDate, lessDate as NSDate)
                         let predicateResult = NSCompoundPredicate.init(andPredicateWithSubpredicates:[predicateDate, self.predicateDefault!])
                         let metadatasResult = NCManageDatabase.shared.getMetadatas(predicate: predicateResult)
                         let metadatasChanged = NCManageDatabase.shared.updateMetadatas(metadatas, metadatasResult: metadatasResult, addCompareLivePhoto: false)
-                        
                         if metadatasChanged.metadatasUpdate.count == 0 {
                             self.researchOldMedia(value: value, limit: limit, withElseReloadDataSource: true)
                         } else {
@@ -648,7 +646,7 @@ extension NCMedia {
                         let predicateResult = NSCompoundPredicate.init(andPredicateWithSubpredicates:[predicate, self.predicate!])
                         let metadatasResult = NCManageDatabase.shared.getMetadatas(predicate: predicateResult)
                         let updateMetadatas = NCManageDatabase.shared.updateMetadatas(metadatas, metadatasResult: metadatasResult, addCompareLivePhoto: false)
-                        if updateMetadatas.metadatasUpdate.count > 0 {
+                        if updateMetadatas.metadatasUpdate.count > 0 || updateMetadatas.metadatasDelete.count > 0 {
                             self.reloadDataSource()
                         }
                     }

+ 12 - 1
iOSClient/More/NCMore.swift

@@ -166,6 +166,15 @@ class NCMore: UIViewController, UITableViewDelegate, UITableViewDataSource {
         item.icon = "gear"
         item.url = "segueSettings"
         settingsMenu.append(item)
+        
+        // ITEM: Test API
+        if NCUtility.shared.isSimulator() {
+            item = NCCommunicationExternalSite()
+            item.name = "Test API"
+            item.icon = "swift"
+            item.url = "test"
+            settingsMenu.append(item)
+        }
 
         if (quotaMenu.count > 0) {
             let item = quotaMenu[0]
@@ -301,7 +310,6 @@ class NCMore: UIViewController, UITableViewDelegate, UITableViewDataSource {
 
     func tableView(_ tableView: UITableView, cellForRowAt indexPath: IndexPath) -> UITableViewCell {
 
-        
         var item = NCCommunicationExternalSite()
 
         // change color selection and disclosure indicator
@@ -444,6 +452,9 @@ class NCMore: UIViewController, UITableViewDelegate, UITableViewDataSource {
             alertController.addAction(actionYes)
             alertController.addAction(actionNo)
             self.present(alertController, animated: true, completion: nil)
+            
+        } else if item.url == "test" {
+            
         }
     }
 }

+ 4 - 1
iOSClient/NCGlobal.swift

@@ -79,7 +79,7 @@ class NCGlobal: NSObject {
     // Database Realm
     //
     let databaseDefault                             = "nextcloud.realm"
-    let databaseSchemaVersion: UInt64               = 178
+    let databaseSchemaVersion: UInt64               = 180
     
     // Intro selector
     //
@@ -168,6 +168,9 @@ class NCGlobal: NSObject {
     let certificateTmp                              = "tmp.der"
     let certificateTmpV2                            = "certificatetmp.der"
     
+    // Extension
+    @objc let extensionPreview                      = "ico"
+    
     // ContentPresenter
     //
     @objc let dismissAfterSecond: TimeInterval      = 4

+ 13 - 16
iOSClient/Networking/NCNetworking.swift

@@ -769,7 +769,7 @@ import Queuer
         
     //MARK: - WebDav Read file, folder
     
-    @objc func readFolder(serverUrl: String, account: String, completion: @escaping (_ account: String, _ metadataFolder: tableMetadata?, _ metadatas: [tableMetadata]?, _ metadatasUpdate: [tableMetadata]?, _ metadatasLocalUpdate: [tableMetadata]?, _ errorCode: Int, _ errorDescription: String)->()) {
+    @objc func readFolder(serverUrl: String, account: String, completion: @escaping (_ account: String, _ metadataFolder: tableMetadata?, _ metadatas: [tableMetadata]?, _ metadatasUpdate: [tableMetadata]?, _ metadatasLocalUpdate: [tableMetadata]?, _ metadatasDelete: [tableMetadata]?, _ errorCode: Int, _ errorDescription: String)->()) {
         
         NCCommunication.shared.readFileOrFolder(serverUrlFileName: serverUrl, depth: "1", showHiddenFiles: CCUtility.getShowHiddenFiles()) { (account, files, responseData, errorCode, errorDescription) in
             
@@ -792,12 +792,12 @@ import Queuer
                     let metadatasResult = NCManageDatabase.shared.getMetadatas(predicate: NSPredicate(format: "account == %@ AND serverUrl == %@ AND status == %d", account, serverUrl, NCGlobal.shared.metadataStatusNormal))
                     let metadatasChanged = NCManageDatabase.shared.updateMetadatas(metadatas, metadatasResult: metadatasResult, addCompareEtagLocal: true)
                     
-                    completion(account, metadataFolder, metadatas, metadatasChanged.metadatasUpdate, metadatasChanged.metadatasLocalUpdate, errorCode, "")
+                    completion(account, metadataFolder, metadatas, metadatasChanged.metadatasUpdate, metadatasChanged.metadatasLocalUpdate, metadatasChanged.metadatasDelete, errorCode, "")
                 }
             
             } else {
                 
-                completion(account, nil, nil, nil, nil, errorCode, errorDescription)
+                completion(account, nil, nil, nil, nil, nil, errorCode, errorDescription)
             }
         }
     }
@@ -1296,12 +1296,11 @@ import Queuer
     
     //MARK: - TEST API
         
-    /*
-    @objc public func getAppPassword(serverUrl: String, username: String, password: String, customUserAgent: String? = nil, completionHandler: @escaping (_ token: String?, _ errorCode: Int, _ errorDescription: String) -> Void) {
+    @objc public func getDirectDownload(urlBase: String, username: String, password: String, fileId: String, customUserAgent: String? = nil, completionHandler: @escaping (_ token: String?, _ errorCode: Int, _ errorDescription: String) -> Void) {
                 
-        let endpoint = "/ocs/v2.php/core/getapppassword"
+        let endpoint = "/ocs/v2.php/apps/dav/api/v1/direct"
         
-        let url:URLConvertible = try! (serverUrl + endpoint).asURL() as URLConvertible
+        let url:URLConvertible = try! (urlBase + endpoint).asURL() as URLConvertible
         var headers: HTTPHeaders = [.authorization(username: username, password: password)]
         if customUserAgent != nil {
             headers.update(.userAgent(customUserAgent!))
@@ -1309,15 +1308,13 @@ import Queuer
         //headers.update(.contentType("application/json"))
         headers.update(name: "OCS-APIRequest", value: "true")
                
-        var urlRequest: URLRequest
-        do {
-            try urlRequest = URLRequest(url: url, method: HTTPMethod(rawValue: "GET"), headers: headers)
-        } catch {
-            completionHandler(nil, error._code, error.localizedDescription)
-            return
-        }
+        let method = HTTPMethod(rawValue: "POST")
+
+        let parameters = [
+            "fileId": fileId,
+        ]
         
-        AF.request(urlRequest).validate(statusCode: 200..<300).response { (response) in
+        AF.request(url, method: method, parameters: parameters, headers: headers).validate(statusCode: 200..<300).response { (response) in
             debugPrint(response)
             
             switch response.result {
@@ -1332,5 +1329,5 @@ import Queuer
             }
         }
     }
-    */
+    
 }

+ 2 - 2
iOSClient/Offline/NCOffline.swift

@@ -97,7 +97,7 @@ class NCOffline: NCCollectionViewCommon  {
             isReloadDataSourceNetworkInProgress = true
             collectionView?.reloadData()
             
-            networkReadFolder(forced: forced) { (metadatas, metadatasUpdate, errorCode, errorDescription) in
+            networkReadFolder(forced: forced) { (metadatas, metadatasUpdate, metadatasDelete, errorCode, errorDescription) in
                 if errorCode == 0 {
                     for metadata in metadatas ?? [] {
                         if !metadata.directory {
@@ -110,7 +110,7 @@ class NCOffline: NCCollectionViewCommon  {
                 
                 self.refreshControl.endRefreshing()
                 self.isReloadDataSourceNetworkInProgress = false
-                if metadatasUpdate?.count ?? 0 > 0 || forced {
+                if metadatasUpdate?.count ?? 0 > 0 || metadatasDelete?.count ?? 0 > 0 || forced {
                     self.reloadDataSource()
                 } else {
                     self.collectionView?.reloadData()

+ 1 - 1
iOSClient/Select/NCSelect.swift

@@ -733,7 +733,7 @@ extension NCSelect {
         networkInProgress = true
         collectionView.reloadData()
         
-        NCNetworking.shared.readFolder(serverUrl: serverUrl, account: activeAccount.account) { (_, _, _, _, _, errorCode, errorDescription) in
+        NCNetworking.shared.readFolder(serverUrl: serverUrl, account: activeAccount.account) { (_, _, _, _, _, _, errorCode, errorDescription) in
             if errorCode != 0 {
                 NCContentPresenter.shared.messageNotification("_error_", description: errorDescription, delay: NCGlobal.shared.dismissAfterSecond, type: NCContentPresenter.messageType.error, errorCode: errorCode)
             }

+ 78 - 4
iOSClient/Settings/CCAdvanced.m

@@ -30,6 +30,7 @@
 @interface CCAdvanced ()
 {
     AppDelegate *appDelegate;
+    XLFormSectionDescriptor *sectionSize;
 }
 @end
 
@@ -232,13 +233,64 @@
         [self presentViewController:capabilities animated:YES completion:nil];
     };
     [section addFormRow:row];
-
-    // Section CLEAR CACHE -------------------------------------------------
     
+    // Section : Delete files / Clear cache --------------------------------------------------------------
+
     section = [XLFormSectionDescriptor formSection];
     [form addFormSection:section];
     section.footerTitle = NSLocalizedString(@"_clear_cache_footer_", nil);
-
+    
+    /*
+    sectionSize = [XLFormSectionDescriptor formSectionWithTitle:NSLocalizedString(@"_delete_files_desc_", nil)];
+    [form addFormSection:sectionSize];
+    sectionSize.footerTitle = NSLocalizedString(@"_clear_cache_footer_", nil);
+
+    
+    row = [XLFormRowDescriptor formRowDescriptorWithTag:@"deleteoldfiles" rowType:XLFormRowDescriptorTypeSelectorPush title:NSLocalizedString(@"_delete_old_files_", nil)];
+    
+    switch (CCUtility.getCleanUpDay) {
+        case 0:
+            row.value = [XLFormOptionsObject formOptionsObjectWithValue:@(0) displayText:NSLocalizedString(@"_never_", nil)];
+            break;
+        case 365:
+            row.value = [XLFormOptionsObject formOptionsObjectWithValue:@(365) displayText:NSLocalizedString(@"_1_year_", nil)];
+            break;
+        case 180:
+            row.value = [XLFormOptionsObject formOptionsObjectWithValue:@(180) displayText:NSLocalizedString(@"_6_months_", nil)];
+            break;
+        case 90:
+            row.value = [XLFormOptionsObject formOptionsObjectWithValue:@(90) displayText:NSLocalizedString(@"_3_months_", nil)];
+            break;
+        case 30:
+            row.value = [XLFormOptionsObject formOptionsObjectWithValue:@(30) displayText:NSLocalizedString(@"_1_month_", nil)];
+            break;
+        case 7:
+            row.value = [XLFormOptionsObject formOptionsObjectWithValue:@(7) displayText:NSLocalizedString(@"_1_week_", nil)];
+            break;
+        case 1:
+            row.value = [XLFormOptionsObject formOptionsObjectWithValue:@(1) displayText:NSLocalizedString(@"_1_day_", nil)];
+            break;
+        default:
+            row.value = [XLFormOptionsObject formOptionsObjectWithValue:@(0) displayText:NSLocalizedString(@"_never_", nil)];
+            break;
+    }
+    
+    [row.cellConfig setObject:[UIFont systemFontOfSize:15.0] forKey:@"textLabel.font"];
+    [row.cellConfig setObject:NCBrandColor.shared.label forKey:@"textLabel.textColor"];
+    row.cellConfigAtConfigure[@"backgroundColor"] = NCBrandColor.shared.secondarySystemGroupedBackground;
+    row.selectorTitle = NSLocalizedString(@"_delete_old_files_", nil);
+    row.selectorOptions = @[[XLFormOptionsObject formOptionsObjectWithValue:@(0) displayText:NSLocalizedString(@"_never_", nil)],
+                            [XLFormOptionsObject formOptionsObjectWithValue:@(365) displayText:NSLocalizedString(@"_1_year_", nil)],
+                            [XLFormOptionsObject formOptionsObjectWithValue:@(180) displayText:NSLocalizedString(@"_6_months_", nil)],
+                            [XLFormOptionsObject formOptionsObjectWithValue:@(90) displayText:NSLocalizedString(@"_3_months_", nil)],
+                            [XLFormOptionsObject formOptionsObjectWithValue:@(30) displayText:NSLocalizedString(@"_1_month_", nil)],
+                            [XLFormOptionsObject formOptionsObjectWithValue:@(7) displayText:NSLocalizedString(@"_1_week_", nil)],
+                            //[XLFormOptionsObject formOptionsObjectWithValue:@(1) displayText:NSLocalizedString(@"_1_day_", nil)],
+                            ];
+    [sectionSize addFormRow:row];
+    */
+    
+    
     // Clear cache
     row = [XLFormRowDescriptor formRowDescriptorWithTag:@"azzeracache" rowType:XLFormRowDescriptorTypeButton title:NSLocalizedString(@"_clear_cache_", nil)];
     row.cellConfigAtConfigure[@"backgroundColor"] = NCBrandColor.shared.secondarySystemGroupedBackground;
@@ -247,8 +299,9 @@
     [row.cellConfig setObject:@(NSTextAlignmentLeft) forKey:@"textLabel.textAlignment"];
     [row.cellConfig setObject:[[UIImage imageNamed:@"trash"] imageWithColor:NCBrandColor.shared.gray size:25] forKey:@"imageView.image"];
     row.action.formSelector = @selector(clearCacheRequest:);
+    //[sectionSize addFormRow:row];
     [section addFormRow:row];
-
+    
     // Section EXIT --------------------------------------------------------
     
     section = [XLFormSectionDescriptor formSection];
@@ -282,6 +335,7 @@
     self.tableView.backgroundColor = NCBrandColor.shared.systemGroupedBackground;
     
     [self initializeForm];
+    [self calculateSize];
 }
 
 - (void)viewWillAppear:(BOOL)animated
@@ -352,6 +406,12 @@
         NSInteger chunkSize = [[rowDescriptor.value valueData] intValue];
         [CCUtility setChunkSize:chunkSize];
     }
+    
+    if ([rowDescriptor.tag isEqualToString:@"deleteoldfiles"]) {
+        
+        NSInteger days = [[rowDescriptor.value valueData] intValue];
+        [CCUtility setCleanUpDay:days];
+    }
 }
 
 #pragma mark - Clear Cache
@@ -386,6 +446,7 @@
     
     dispatch_after(dispatch_time(DISPATCH_TIME_NOW, 1 * NSEC_PER_SEC), dispatch_get_main_queue(), ^(void) {
         [[NCUtility shared] stopActivityIndicator];
+        [self calculateSize];
     });
 }
 
@@ -413,6 +474,19 @@
     [self presentViewController:alertController animated:YES completion:nil];
 }
 
+- (void)calculateSize
+{
+    dispatch_async(dispatch_get_global_queue(DISPATCH_QUEUE_PRIORITY_DEFAULT, 0), ^{
+        NSString *directory = CCUtility.getDirectoryProviderStorage;
+        int64_t totalSize = [[NCUtilityFileSystem shared] getDirectorySizeWithDirectory:directory];
+        sectionSize.footerTitle = [NSString stringWithFormat:@"%@. (%@ %@)", NSLocalizedString(@"_clear_cache_footer_", nil), NSLocalizedString(@"_used_space_", nil), [CCUtility transformedSize:totalSize]];
+            
+        dispatch_async(dispatch_get_main_queue(), ^{
+            [self.tableView reloadData];
+        });
+    });
+}
+
 #pragma mark - Exit Nextcloud
 
 - (void)exitNextcloud:(XLFormRowDescriptor *)sender

BIN
iOSClient/Supporting Files/af.lproj/Localizable.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


+ 10 - 3
iOSClient/Supporting Files/en.lproj/Localizable.strings

@@ -803,9 +803,16 @@
 "_save_as_copy_"            = "Save as copy";
 "_discard_changes_"         = "Close and discard changes";
 "_message_disable_overwrite_livephoto_" = "This image it's a Live Photo, the overwrite will not possible";
-"_cleanup_"                 = "Cleanup";
-"_remove_old_files_desc_"   = "Remove all unused files from the chosen days (0-365, 0 is disabled)";
-"_remove_old_files_"        = "Remove all files older than";
+"_delete_files_desc_"       = "Delete files to free up space";
+"_delete_old_files_"        = "Delete all files older than";
+"_never_"                   = "Never";
+"_1_year_"                  = "1 year";
+"_6_months_"                = "6 months";
+"_3_months_"                = "3 months";
+"_1_month_"                 = "1 month";
+"_1_week_"                  = "1 week";
+"_1_day_"                   = "1 day";
+"_used_space_"              = "Used space";
 
 // ----------------------------------------------------------------------------------------------------------------------------------
 // IM

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/fr.lproj/Localizable.strings


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


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


BIN
iOSClient/Supporting Files/hr.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/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/km.lproj/Localizable.strings


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


BIN
iOSClient/Supporting Files/ko.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


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


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


BIN
iOSClient/Supporting Files/nb-NO.lproj/Localizable.strings


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


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


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


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


BIN
iOSClient/Supporting Files/pt-BR.lproj/Localizable.strings


BIN
iOSClient/Supporting Files/pt-PT.lproj/Localizable.strings


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


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


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


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


BIN
iOSClient/Supporting Files/sk-SK.lproj/Localizable.strings


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


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


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


BIN
iOSClient/Supporting Files/sr@latin.lproj/Localizable.strings


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


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


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


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


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