Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/nextcloud/ios.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authormarinofaggiana <marino@marinofaggiana.com>2021-06-23 20:12:11 +0300
committermarinofaggiana <marino@marinofaggiana.com>2021-06-23 20:12:11 +0300
commit7ebc212548ebb511a83b34bb7f2e8630b26cfd35 (patch)
treec97b17539e5573b305b0577aaa5e986b09fc2cfc
parentfcc209aeb82fdb6a9d77739420931ed8292af435 (diff)
parentbfb03d241a538c9b99510db5661a420022def997 (diff)
Merge branch 'develop'4.0.2
-rwxr-xr-xNextcloud.xcodeproj/project.pbxproj34
-rw-r--r--Nextcloud.xcodeproj/project.xcworkspace/xcshareddata/swiftpm/Package.resolved8
-rw-r--r--Share/NCShareExtension.swift2
-rw-r--r--iOSClient/AppDelegate.swift26
-rw-r--r--iOSClient/Data/NCManageDatabase.swift14
-rw-r--r--iOSClient/Favorites/NCFavorite.swift4
-rw-r--r--iOSClient/FileViewInFolder/NCFileViewInFolder.swift2
-rw-r--r--iOSClient/Files/NCFiles.swift4
-rw-r--r--iOSClient/Main/AudioRecorder/NCAudioRecorderViewController.swift32
-rw-r--r--iOSClient/Main/Collection Common/NCCollectionViewCommon.swift17
-rw-r--r--iOSClient/Main/Create cloud/NCCreateFormUploadVoiceNote.swift48
-rw-r--r--iOSClient/Media/NCMedia.swift4
-rw-r--r--iOSClient/More/NCMore.swift13
-rw-r--r--iOSClient/NCGlobal.swift5
-rw-r--r--iOSClient/Networking/NCNetworking.swift29
-rw-r--r--iOSClient/Offline/NCOffline.swift4
-rw-r--r--iOSClient/Select/NCSelect.swift2
-rwxr-xr-xiOSClient/Settings/CCAdvanced.m82
-rw-r--r--iOSClient/Supporting Files/af.lproj/Localizable.stringsbin99990 -> 100486 bytes
-rw-r--r--iOSClient/Supporting Files/ar.lproj/Localizable.stringsbin97146 -> 97644 bytes
-rw-r--r--iOSClient/Supporting Files/ast.lproj/Localizable.stringsbin100190 -> 100686 bytes
-rw-r--r--iOSClient/Supporting Files/az.lproj/Localizable.stringsbin99642 -> 100144 bytes
-rw-r--r--iOSClient/Supporting Files/be.lproj/Localizable.stringsbin99462 -> 99958 bytes
-rw-r--r--iOSClient/Supporting Files/bg_BG.lproj/Localizable.stringsbin101236 -> 101734 bytes
-rw-r--r--iOSClient/Supporting Files/bn_BD.lproj/Localizable.stringsbin99590 -> 100092 bytes
-rw-r--r--iOSClient/Supporting Files/br.lproj/Localizable.stringsbin104662 -> 105158 bytes
-rw-r--r--iOSClient/Supporting Files/bs.lproj/Localizable.stringsbin99592 -> 100088 bytes
-rw-r--r--iOSClient/Supporting Files/ca.lproj/Localizable.stringsbin107184 -> 107676 bytes
-rw-r--r--iOSClient/Supporting Files/cs-CZ.lproj/Localizable.stringsbin102296 -> 102836 bytes
-rw-r--r--iOSClient/Supporting Files/cy_GB.lproj/Localizable.stringsbin99582 -> 100076 bytes
-rw-r--r--iOSClient/Supporting Files/da.lproj/Localizable.stringsbin99936 -> 100432 bytes
-rw-r--r--iOSClient/Supporting Files/de.lproj/Localizable.stringsbin108626 -> 109204 bytes
-rw-r--r--iOSClient/Supporting Files/el.lproj/Localizable.stringsbin109346 -> 109840 bytes
-rw-r--r--iOSClient/Supporting Files/en-GB.lproj/Localizable.stringsbin99394 -> 99890 bytes
-rw-r--r--iOSClient/Supporting Files/en.lproj/Localizable.strings13
-rw-r--r--iOSClient/Supporting Files/eo.lproj/Localizable.stringsbin100104 -> 100602 bytes
-rw-r--r--iOSClient/Supporting Files/es-419.lproj/Localizable.stringsbin103774 -> 104270 bytes
-rw-r--r--iOSClient/Supporting Files/es-AR.lproj/Localizable.stringsbin102640 -> 103136 bytes
-rw-r--r--iOSClient/Supporting Files/es-CL.lproj/Localizable.stringsbin104400 -> 104896 bytes
-rw-r--r--iOSClient/Supporting Files/es-CO.lproj/Localizable.stringsbin104400 -> 104896 bytes
-rw-r--r--iOSClient/Supporting Files/es-CR.lproj/Localizable.stringsbin104400 -> 104896 bytes
-rw-r--r--iOSClient/Supporting Files/es-DO.lproj/Localizable.stringsbin104400 -> 104896 bytes
-rw-r--r--iOSClient/Supporting Files/es-EC.lproj/Localizable.stringsbin104406 -> 104902 bytes
-rw-r--r--iOSClient/Supporting Files/es-GT.lproj/Localizable.stringsbin104400 -> 104896 bytes
-rw-r--r--iOSClient/Supporting Files/es-HN.lproj/Localizable.stringsbin103762 -> 104258 bytes
-rw-r--r--iOSClient/Supporting Files/es-MX.lproj/Localizable.stringsbin104558 -> 105054 bytes
-rw-r--r--iOSClient/Supporting Files/es-NI.lproj/Localizable.stringsbin103762 -> 104258 bytes
-rw-r--r--iOSClient/Supporting Files/es-PA.lproj/Localizable.stringsbin103762 -> 104258 bytes
-rw-r--r--iOSClient/Supporting Files/es-PE.lproj/Localizable.stringsbin103762 -> 104258 bytes
-rw-r--r--iOSClient/Supporting Files/es-PR.lproj/Localizable.stringsbin103762 -> 104258 bytes
-rw-r--r--iOSClient/Supporting Files/es-PY.lproj/Localizable.stringsbin103788 -> 104284 bytes
-rw-r--r--iOSClient/Supporting Files/es-SV.lproj/Localizable.stringsbin104400 -> 104896 bytes
-rw-r--r--iOSClient/Supporting Files/es-UY.lproj/Localizable.stringsbin103762 -> 104258 bytes
-rw-r--r--iOSClient/Supporting Files/es.lproj/Localizable.stringsbin106694 -> 107294 bytes
-rw-r--r--iOSClient/Supporting Files/et_EE.lproj/Localizable.stringsbin99958 -> 100468 bytes
-rw-r--r--iOSClient/Supporting Files/eu.lproj/Localizable.stringsbin105930 -> 106518 bytes
-rw-r--r--iOSClient/Supporting Files/fa.lproj/Localizable.stringsbin100506 -> 101000 bytes
-rw-r--r--iOSClient/Supporting Files/fi-FI.lproj/Localizable.stringsbin102122 -> 102628 bytes
-rw-r--r--iOSClient/Supporting Files/fr.lproj/Localizable.stringsbin110008 -> 110506 bytes
-rw-r--r--iOSClient/Supporting Files/gl.lproj/Localizable.stringsbin106972 -> 107468 bytes
-rw-r--r--iOSClient/Supporting Files/he.lproj/Localizable.stringsbin97618 -> 98070 bytes
-rw-r--r--iOSClient/Supporting Files/hr.lproj/Localizable.stringsbin104330 -> 104826 bytes
-rw-r--r--iOSClient/Supporting Files/hu.lproj/Localizable.stringsbin103424 -> 103918 bytes
-rw-r--r--iOSClient/Supporting Files/hy.lproj/Localizable.stringsbin99640 -> 100136 bytes
-rw-r--r--iOSClient/Supporting Files/ia.lproj/Localizable.stringsbin100060 -> 100560 bytes
-rw-r--r--iOSClient/Supporting Files/id.lproj/Localizable.stringsbin100058 -> 100570 bytes
-rw-r--r--iOSClient/Supporting Files/is.lproj/Localizable.stringsbin101748 -> 102246 bytes
-rw-r--r--iOSClient/Supporting Files/it.lproj/Localizable.stringsbin106392 -> 106918 bytes
-rw-r--r--iOSClient/Supporting Files/ja-JP.lproj/Localizable.stringsbin85352 -> 85608 bytes
-rw-r--r--iOSClient/Supporting Files/ka-GE.lproj/Localizable.stringsbin102652 -> 103154 bytes
-rw-r--r--iOSClient/Supporting Files/km.lproj/Localizable.stringsbin99568 -> 100066 bytes
-rw-r--r--iOSClient/Supporting Files/kn.lproj/Localizable.stringsbin99816 -> 100316 bytes
-rw-r--r--iOSClient/Supporting Files/ko.lproj/Localizable.stringsbin81638 -> 82134 bytes
-rw-r--r--iOSClient/Supporting Files/lb.lproj/Localizable.stringsbin99698 -> 100188 bytes
-rw-r--r--iOSClient/Supporting Files/lo.lproj/Localizable.stringsbin97478 -> 97978 bytes
-rw-r--r--iOSClient/Supporting Files/lt_LT.lproj/Localizable.stringsbin102206 -> 102706 bytes
-rw-r--r--iOSClient/Supporting Files/lv.lproj/Localizable.stringsbin100422 -> 100918 bytes
-rw-r--r--iOSClient/Supporting Files/mk.lproj/Localizable.stringsbin100756 -> 101256 bytes
-rw-r--r--iOSClient/Supporting Files/mn.lproj/Localizable.stringsbin100108 -> 100618 bytes
-rw-r--r--iOSClient/Supporting Files/ms_MY.lproj/Localizable.stringsbin99456 -> 99954 bytes
-rw-r--r--iOSClient/Supporting Files/nb-NO.lproj/Localizable.stringsbin100544 -> 101040 bytes
-rw-r--r--iOSClient/Supporting Files/nl.lproj/Localizable.stringsbin104548 -> 105048 bytes
-rw-r--r--iOSClient/Supporting Files/nn_NO.lproj/Localizable.stringsbin99454 -> 99950 bytes
-rw-r--r--iOSClient/Supporting Files/oc.lproj/Localizable.stringsbin99854 -> 100358 bytes
-rw-r--r--iOSClient/Supporting Files/pl.lproj/Localizable.stringsbin103790 -> 104332 bytes
-rw-r--r--iOSClient/Supporting Files/pt-BR.lproj/Localizable.stringsbin104584 -> 105118 bytes
-rw-r--r--iOSClient/Supporting Files/pt-PT.lproj/Localizable.stringsbin103572 -> 104068 bytes
-rw-r--r--iOSClient/Supporting Files/ro.lproj/Localizable.stringsbin100314 -> 100818 bytes
-rw-r--r--iOSClient/Supporting Files/ru.lproj/Localizable.stringsbin104712 -> 105212 bytes
-rw-r--r--iOSClient/Supporting Files/sc.lproj/Localizable.stringsbin109020 -> 109534 bytes
-rw-r--r--iOSClient/Supporting Files/si.lproj/Localizable.stringsbin100292 -> 100788 bytes
-rw-r--r--iOSClient/Supporting Files/sk-SK.lproj/Localizable.stringsbin103202 -> 103698 bytes
-rw-r--r--iOSClient/Supporting Files/sl.lproj/Localizable.stringsbin105618 -> 106116 bytes
-rw-r--r--iOSClient/Supporting Files/sq.lproj/Localizable.stringsbin101156 -> 101660 bytes
-rw-r--r--iOSClient/Supporting Files/sr.lproj/Localizable.stringsbin101272 -> 101768 bytes
-rw-r--r--iOSClient/Supporting Files/sr@latin.lproj/Localizable.stringsbin99620 -> 100116 bytes
-rw-r--r--iOSClient/Supporting Files/sv.lproj/Localizable.stringsbin101214 -> 101712 bytes
-rw-r--r--iOSClient/Supporting Files/ta.lproj/Localizable.stringsbin99654 -> 100158 bytes
-rw-r--r--iOSClient/Supporting Files/th_TH.lproj/Localizable.stringsbin99554 -> 100060 bytes
-rw-r--r--iOSClient/Supporting Files/tr.lproj/Localizable.stringsbin103350 -> 103844 bytes
-rw-r--r--iOSClient/Supporting Files/ug.lproj/Localizable.stringsbin99500 -> 99998 bytes
-rw-r--r--iOSClient/Supporting Files/uk.lproj/Localizable.stringsbin100714 -> 101212 bytes
-rw-r--r--iOSClient/Supporting Files/ur_PK.lproj/Localizable.stringsbin99404 -> 99900 bytes
-rw-r--r--iOSClient/Supporting Files/vi.lproj/Localizable.stringsbin100052 -> 100566 bytes
-rw-r--r--iOSClient/Supporting Files/zh-Hans.lproj/Localizable.stringsbin74444 -> 74836 bytes
-rw-r--r--iOSClient/Supporting Files/zh-Hant-TW.lproj/Localizable.stringsbin79466 -> 79956 bytes
-rw-r--r--iOSClient/Supporting Files/zh_HK.lproj/Localizable.stringsbin75014 -> 75392 bytes
-rw-r--r--iOSClient/Utility/CCUtility.h4
-rw-r--r--iOSClient/Utility/CCUtility.m31
-rw-r--r--iOSClient/Utility/NCUtilityFileSystem.swift53
-rw-r--r--iOSClient/Viewer/NCViewerImage/NCViewerImage.swift61
-rw-r--r--iOSClient/Viewer/NCViewerVideo/NCViewerVideo.swift24
112 files changed, 395 insertions, 121 deletions
diff --git a/Nextcloud.xcodeproj/project.pbxproj b/Nextcloud.xcodeproj/project.pbxproj
index c58046547..4a92d8fe6 100755
--- a/Nextcloud.xcodeproj/project.pbxproj
+++ b/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" */ = {
diff --git a/Nextcloud.xcodeproj/project.xcworkspace/xcshareddata/swiftpm/Package.resolved b/Nextcloud.xcodeproj/project.xcworkspace/xcshareddata/swiftpm/Package.resolved
index d2a432001..17627a60f 100644
--- a/Nextcloud.xcodeproj/project.xcworkspace/xcshareddata/swiftpm/Package.resolved
+++ b/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"
}
},
{
diff --git a/Share/NCShareExtension.swift b/Share/NCShareExtension.swift
index a292c5241..1960bb53d 100644
--- a/Share/NCShareExtension.swift
+++ b/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 }))
diff --git a/iOSClient/AppDelegate.swift b/iOSClient/AppDelegate.swift
index eb7d3de55..dd625663a 100644
--- a/iOSClient/AppDelegate.swift
+++ b/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, *)
diff --git a/iOSClient/Data/NCManageDatabase.swift b/iOSClient/Data/NCManageDatabase.swift
index b7c6edcf2..7e0b170eb 100644
--- a/iOSClient/Data/NCManageDatabase.swift
+++ b/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) {
diff --git a/iOSClient/Favorites/NCFavorite.swift b/iOSClient/Favorites/NCFavorite.swift
index 67b7ddc7f..f59695cb5 100644
--- a/iOSClient/Favorites/NCFavorite.swift
+++ b/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()
diff --git a/iOSClient/FileViewInFolder/NCFileViewInFolder.swift b/iOSClient/FileViewInFolder/NCFileViewInFolder.swift
index 7eb2fe6ce..d370d4ce2 100644
--- a/iOSClient/FileViewInFolder/NCFileViewInFolder.swift
+++ b/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 {
diff --git a/iOSClient/Files/NCFiles.swift b/iOSClient/Files/NCFiles.swift
index cdb56d525..638876fde 100644
--- a/iOSClient/Files/NCFiles.swift
+++ b/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()
diff --git a/iOSClient/Main/AudioRecorder/NCAudioRecorderViewController.swift b/iOSClient/Main/AudioRecorder/NCAudioRecorderViewController.swift
index 8c180d135..26d3c2061 100644
--- a/iOSClient/Main/AudioRecorder/NCAudioRecorderViewController.swift
+++ b/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
}
diff --git a/iOSClient/Main/Collection Common/NCCollectionViewCommon.swift b/iOSClient/Main/Collection Common/NCCollectionViewCommon.swift
index 6301128c7..7697a698d 100644
--- a/iOSClient/Main/Collection Common/NCCollectionViewCommon.swift
+++ b/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) {
diff --git a/iOSClient/Main/Create cloud/NCCreateFormUploadVoiceNote.swift b/iOSClient/Main/Create cloud/NCCreateFormUploadVoiceNote.swift
index 972d887cb..5cf63c84f 100644
--- a/iOSClient/Main/Create cloud/NCCreateFormUploadVoiceNote.swift
+++ b/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()
diff --git a/iOSClient/Media/NCMedia.swift b/iOSClient/Media/NCMedia.swift
index 6b1df8bf5..c0ed8c91c 100644
--- a/iOSClient/Media/NCMedia.swift
+++ b/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()
}
}
diff --git a/iOSClient/More/NCMore.swift b/iOSClient/More/NCMore.swift
index 6c24b6a26..b408f441f 100644
--- a/iOSClient/More/NCMore.swift
+++ b/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" {
+
}
}
}
diff --git a/iOSClient/NCGlobal.swift b/iOSClient/NCGlobal.swift
index 0f01c1d88..2759a2c23 100644
--- a/iOSClient/NCGlobal.swift
+++ b/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
diff --git a/iOSClient/Networking/NCNetworking.swift b/iOSClient/Networking/NCNetworking.swift
index ea886ac11..5c1af491a 100644
--- a/iOSClient/Networking/NCNetworking.swift
+++ b/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
}
}
}
- */
+
}
diff --git a/iOSClient/Offline/NCOffline.swift b/iOSClient/Offline/NCOffline.swift
index b9688a1e0..8716e3b80 100644
--- a/iOSClient/Offline/NCOffline.swift
+++ b/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()
diff --git a/iOSClient/Select/NCSelect.swift b/iOSClient/Select/NCSelect.swift
index 4acd5b2c3..070b82a60 100644
--- a/iOSClient/Select/NCSelect.swift
+++ b/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)
}
diff --git a/iOSClient/Settings/CCAdvanced.m b/iOSClient/Settings/CCAdvanced.m
index 8874fcc5f..715812039 100755
--- a/iOSClient/Settings/CCAdvanced.m
+++ b/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
diff --git a/iOSClient/Supporting Files/af.lproj/Localizable.strings b/iOSClient/Supporting Files/af.lproj/Localizable.strings
index 7b8dbd009..10b4e00f1 100644
--- a/iOSClient/Supporting Files/af.lproj/Localizable.strings
+++ b/iOSClient/Supporting Files/af.lproj/Localizable.strings
Binary files differ
diff --git a/iOSClient/Supporting Files/ar.lproj/Localizable.strings b/iOSClient/Supporting Files/ar.lproj/Localizable.strings
index 4e20fa516..ad76b2192 100644
--- a/iOSClient/Supporting Files/ar.lproj/Localizable.strings
+++ b/iOSClient/Supporting Files/ar.lproj/Localizable.strings
Binary files differ
diff --git a/iOSClient/Supporting Files/ast.lproj/Localizable.strings b/iOSClient/Supporting Files/ast.lproj/Localizable.strings
index 507526f5b..f2463c9f2 100644
--- a/iOSClient/Supporting Files/ast.lproj/Localizable.strings
+++ b/iOSClient/Supporting Files/ast.lproj/Localizable.strings
Binary files differ
diff --git a/iOSClient/Supporting Files/az.lproj/Localizable.strings b/iOSClient/Supporting Files/az.lproj/Localizable.strings
index 4876d21f0..92b8efaec 100644
--- a/iOSClient/Supporting Files/az.lproj/Localizable.strings
+++ b/iOSClient/Supporting Files/az.lproj/Localizable.strings
Binary files differ
diff --git a/iOSClient/Supporting Files/be.lproj/Localizable.strings b/iOSClient/Supporting Files/be.lproj/Localizable.strings
index d81396ce0..eb326c5ed 100644
--- a/iOSClient/Supporting Files/be.lproj/Localizable.strings
+++ b/iOSClient/Supporting Files/be.lproj/Localizable.strings
Binary files differ
diff --git a/iOSClient/Supporting Files/bg_BG.lproj/Localizable.strings b/iOSClient/Supporting Files/bg_BG.lproj/Localizable.strings
index be3c69750..de453ce5e 100644
--- a/iOSClient/Supporting Files/bg_BG.lproj/Localizable.strings
+++ b/iOSClient/Supporting Files/bg_BG.lproj/Localizable.strings
Binary files differ
diff --git a/iOSClient/Supporting Files/bn_BD.lproj/Localizable.strings b/iOSClient/Supporting Files/bn_BD.lproj/Localizable.strings
index 735b62934..375d257ed 100644
--- a/iOSClient/Supporting Files/bn_BD.lproj/Localizable.strings
+++ b/iOSClient/Supporting Files/bn_BD.lproj/Localizable.strings
Binary files differ
diff --git a/iOSClient/Supporting Files/br.lproj/Localizable.strings b/iOSClient/Supporting Files/br.lproj/Localizable.strings
index 94d3d3145..73660af72 100644
--- a/iOSClient/Supporting Files/br.lproj/Localizable.strings
+++ b/iOSClient/Supporting Files/br.lproj/Localizable.strings
Binary files differ
diff --git a/iOSClient/Supporting Files/bs.lproj/Localizable.strings b/iOSClient/Supporting Files/bs.lproj/Localizable.strings
index b8aa3ed96..2e965953b 100644
--- a/iOSClient/Supporting Files/bs.lproj/Localizable.strings
+++ b/iOSClient/Supporting Files/bs.lproj/Localizable.strings
Binary files differ
diff --git a/iOSClient/Supporting Files/ca.lproj/Localizable.strings b/iOSClient/Supporting Files/ca.lproj/Localizable.strings
index b04c70219..e8a889aab 100644
--- a/iOSClient/Supporting Files/ca.lproj/Localizable.strings
+++ b/iOSClient/Supporting Files/ca.lproj/Localizable.strings
Binary files differ
diff --git a/iOSClient/Supporting Files/cs-CZ.lproj/Localizable.strings b/iOSClient/Supporting Files/cs-CZ.lproj/Localizable.strings
index 846bf56a2..cde209243 100644
--- a/iOSClient/Supporting Files/cs-CZ.lproj/Localizable.strings
+++ b/iOSClient/Supporting Files/cs-CZ.lproj/Localizable.strings
Binary files differ
diff --git a/iOSClient/Supporting Files/cy_GB.lproj/Localizable.strings b/iOSClient/Supporting Files/cy_GB.lproj/Localizable.strings
index a61e61722..85a5e3e88 100644
--- a/iOSClient/Supporting Files/cy_GB.lproj/Localizable.strings
+++ b/iOSClient/Supporting Files/cy_GB.lproj/Localizable.strings
Binary files differ
diff --git a/iOSClient/Supporting Files/da.lproj/Localizable.strings b/iOSClient/Supporting Files/da.lproj/Localizable.strings
index 0cf9d9f2a..c46eef5e9 100644
--- a/iOSClient/Supporting Files/da.lproj/Localizable.strings
+++ b/iOSClient/Supporting Files/da.lproj/Localizable.strings
Binary files differ
diff --git a/iOSClient/Supporting Files/de.lproj/Localizable.strings b/iOSClient/Supporting Files/de.lproj/Localizable.strings
index 9e83c7ee1..5c3051de3 100644
--- a/iOSClient/Supporting Files/de.lproj/Localizable.strings
+++ b/iOSClient/Supporting Files/de.lproj/Localizable.strings
Binary files differ
diff --git a/iOSClient/Supporting Files/el.lproj/Localizable.strings b/iOSClient/Supporting Files/el.lproj/Localizable.strings
index 50789f945..b46a04b8a 100644
--- a/iOSClient/Supporting Files/el.lproj/Localizable.strings
+++ b/iOSClient/Supporting Files/el.lproj/Localizable.strings
Binary files differ
diff --git a/iOSClient/Supporting Files/en-GB.lproj/Localizable.strings b/iOSClient/Supporting Files/en-GB.lproj/Localizable.strings
index b4067ccf7..baf8968d9 100644
--- a/iOSClient/Supporting Files/en-GB.lproj/Localizable.strings
+++ b/iOSClient/Supporting Files/en-GB.lproj/Localizable.strings
Binary files differ
diff --git a/iOSClient/Supporting Files/en.lproj/Localizable.strings b/iOSClient/Supporting Files/en.lproj/Localizable.strings
index dd2fee5cc..9e2c8da68 100644
--- a/iOSClient/Supporting Files/en.lproj/Localizable.strings
+++ b/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
diff --git a/iOSClient/Supporting Files/eo.lproj/Localizable.strings b/iOSClient/Supporting Files/eo.lproj/Localizable.strings
index a99f6d59c..058876e5e 100644
--- a/iOSClient/Supporting Files/eo.lproj/Localizable.strings
+++ b/iOSClient/Supporting Files/eo.lproj/Localizable.strings
Binary files differ
diff --git a/iOSClient/Supporting Files/es-419.lproj/Localizable.strings b/iOSClient/Supporting Files/es-419.lproj/Localizable.strings
index 08d6f0a43..18a6ecc3c 100644
--- a/iOSClient/Supporting Files/es-419.lproj/Localizable.strings
+++ b/iOSClient/Supporting Files/es-419.lproj/Localizable.strings
Binary files differ
diff --git a/iOSClient/Supporting Files/es-AR.lproj/Localizable.strings b/iOSClient/Supporting Files/es-AR.lproj/Localizable.strings
index 360aa3980..52a5801a5 100644
--- a/iOSClient/Supporting Files/es-AR.lproj/Localizable.strings
+++ b/iOSClient/Supporting Files/es-AR.lproj/Localizable.strings
Binary files differ
diff --git a/iOSClient/Supporting Files/es-CL.lproj/Localizable.strings b/iOSClient/Supporting Files/es-CL.lproj/Localizable.strings
index 77d546eb9..dc6a62d31 100644
--- a/iOSClient/Supporting Files/es-CL.lproj/Localizable.strings
+++ b/iOSClient/Supporting Files/es-CL.lproj/Localizable.strings
Binary files differ
diff --git a/iOSClient/Supporting Files/es-CO.lproj/Localizable.strings b/iOSClient/Supporting Files/es-CO.lproj/Localizable.strings
index 77d546eb9..dc6a62d31 100644
--- a/iOSClient/Supporting Files/es-CO.lproj/Localizable.strings
+++ b/iOSClient/Supporting Files/es-CO.lproj/Localizable.strings
Binary files differ
diff --git a/iOSClient/Supporting Files/es-CR.lproj/Localizable.strings b/iOSClient/Supporting Files/es-CR.lproj/Localizable.strings
index 77d546eb9..dc6a62d31 100644
--- a/iOSClient/Supporting Files/es-CR.lproj/Localizable.strings
+++ b/iOSClient/Supporting Files/es-CR.lproj/Localizable.strings
Binary files differ
diff --git a/iOSClient/Supporting Files/es-DO.lproj/Localizable.strings b/iOSClient/Supporting Files/es-DO.lproj/Localizable.strings
index 77d546eb9..dc6a62d31 100644
--- a/iOSClient/Supporting Files/es-DO.lproj/Localizable.strings
+++ b/iOSClient/Supporting Files/es-DO.lproj/Localizable.strings
Binary files differ
diff --git a/iOSClient/Supporting Files/es-EC.lproj/Localizable.strings b/iOSClient/Supporting Files/es-EC.lproj/Localizable.strings
index d718a4b26..31fb5f29c 100644
--- a/iOSClient/Supporting Files/es-EC.lproj/Localizable.strings
+++ b/iOSClient/Supporting Files/es-EC.lproj/Localizable.strings
Binary files differ
diff --git a/iOSClient/Supporting Files/es-GT.lproj/Localizable.strings b/iOSClient/Supporting Files/es-GT.lproj/Localizable.strings
index 77d546eb9..dc6a62d31 100644
--- a/iOSClient/Supporting Files/es-GT.lproj/Localizable.strings
+++ b/iOSClient/Supporting Files/es-GT.lproj/Localizable.strings
Binary files differ
diff --git a/iOSClient/Supporting Files/es-HN.lproj/Localizable.strings b/iOSClient/Supporting Files/es-HN.lproj/Localizable.strings
index 7e69e003f..242cce485 100644
--- a/iOSClient/Supporting Files/es-HN.lproj/Localizable.strings
+++ b/iOSClient/Supporting Files/es-HN.lproj/Localizable.strings
Binary files differ
diff --git a/iOSClient/Supporting Files/es-MX.lproj/Localizable.strings b/iOSClient/Supporting Files/es-MX.lproj/Localizable.strings
index 26556f23e..74e73594c 100644
--- a/iOSClient/Supporting Files/es-MX.lproj/Localizable.strings
+++ b/iOSClient/Supporting Files/es-MX.lproj/Localizable.strings
Binary files differ
diff --git a/iOSClient/Supporting Files/es-NI.lproj/Localizable.strings b/iOSClient/Supporting Files/es-NI.lproj/Localizable.strings
index 7e69e003f..242cce485 100644
--- a/iOSClient/Supporting Files/es-NI.lproj/Localizable.strings
+++ b/iOSClient/Supporting Files/es-NI.lproj/Localizable.strings
Binary files differ
diff --git a/iOSClient/Supporting Files/es-PA.lproj/Localizable.strings b/iOSClient/Supporting Files/es-PA.lproj/Localizable.strings
index 7e69e003f..242cce485 100644
--- a/iOSClient/Supporting Files/es-PA.lproj/Localizable.strings
+++ b/iOSClient/Supporting Files/es-PA.lproj/Localizable.strings
Binary files differ
diff --git a/iOSClient/Supporting Files/es-PE.lproj/Localizable.strings b/iOSClient/Supporting Files/es-PE.lproj/Localizable.strings
index 7e69e003f..242cce485 100644
--- a/iOSClient/Supporting Files/es-PE.lproj/Localizable.strings
+++ b/iOSClient/Supporting Files/es-PE.lproj/Localizable.strings
Binary files differ
diff --git a/iOSClient/Supporting Files/es-PR.lproj/Localizable.strings b/iOSClient/Supporting Files/es-PR.lproj/Localizable.strings
index 7e69e003f..242cce485 100644
--- a/iOSClient/Supporting Files/es-PR.lproj/Localizable.strings
+++ b/iOSClient/Supporting Files/es-PR.lproj/Localizable.strings
Binary files differ
diff --git a/iOSClient/Supporting Files/es-PY.lproj/Localizable.strings b/iOSClient/Supporting Files/es-PY.lproj/Localizable.strings
index 7147660f1..c7cf1260e 100644
--- a/iOSClient/Supporting Files/es-PY.lproj/Localizable.strings
+++ b/iOSClient/Supporting Files/es-PY.lproj/Localizable.strings
Binary files differ
diff --git a/iOSClient/Supporting Files/es-SV.lproj/Localizable.strings b/iOSClient/Supporting Files/es-SV.lproj/Localizable.strings
index 77d546eb9..dc6a62d31 100644
--- a/iOSClient/Supporting Files/es-SV.lproj/Localizable.strings
+++ b/iOSClient/Supporting Files/es-SV.lproj/Localizable.strings
Binary files differ
diff --git a/iOSClient/Supporting Files/es-UY.lproj/Localizable.strings b/iOSClient/Supporting Files/es-UY.lproj/Localizable.strings
index 7e69e003f..242cce485 100644
--- a/iOSClient/Supporting Files/es-UY.lproj/Localizable.strings
+++ b/iOSClient/Supporting Files/es-UY.lproj/Localizable.strings
Binary files differ
diff --git a/iOSClient/Supporting Files/es.lproj/Localizable.strings b/iOSClient/Supporting Files/es.lproj/Localizable.strings
index d4ea9786e..0a10d2b4c 100644
--- a/iOSClient/Supporting Files/es.lproj/Localizable.strings
+++ b/iOSClient/Supporting Files/es.lproj/Localizable.strings
Binary files differ
diff --git a/iOSClient/Supporting Files/et_EE.lproj/Localizable.strings b/iOSClient/Supporting Files/et_EE.lproj/Localizable.strings
index 63eed3e01..e16b8d142 100644
--- a/iOSClient/Supporting Files/et_EE.lproj/Localizable.strings
+++ b/iOSClient/Supporting Files/et_EE.lproj/Localizable.strings
Binary files differ
diff --git a/iOSClient/Supporting Files/eu.lproj/Localizable.strings b/iOSClient/Supporting Files/eu.lproj/Localizable.strings
index 871d6d81d..77f518872 100644
--- a/iOSClient/Supporting Files/eu.lproj/Localizable.strings
+++ b/iOSClient/Supporting Files/eu.lproj/Localizable.strings
Binary files differ
diff --git a/iOSClient/Supporting Files/fa.lproj/Localizable.strings b/iOSClient/Supporting Files/fa.lproj/Localizable.strings
index a6bba3ecf..b290fe2f2 100644
--- a/iOSClient/Supporting Files/fa.lproj/Localizable.strings
+++ b/iOSClient/Supporting Files/fa.lproj/Localizable.strings
Binary files differ
diff --git a/iOSClient/Supporting Files/fi-FI.lproj/Localizable.strings b/iOSClient/Supporting Files/fi-FI.lproj/Localizable.strings
index 4bcf8fe40..40cc67e3b 100644
--- a/iOSClient/Supporting Files/fi-FI.lproj/Localizable.strings
+++ b/iOSClient/Supporting Files/fi-FI.lproj/Localizable.strings
Binary files differ
diff --git a/iOSClient/Supporting Files/fr.lproj/Localizable.strings b/iOSClient/Supporting Files/fr.lproj/Localizable.strings
index 9971556e1..4cb85a5f6 100644
--- a/iOSClient/Supporting Files/fr.lproj/Localizable.strings
+++ b/iOSClient/Supporting Files/fr.lproj/Localizable.strings
Binary files differ
diff --git a/iOSClient/Supporting Files/gl.lproj/Localizable.strings b/iOSClient/Supporting Files/gl.lproj/Localizable.strings
index 0fa166f0e..259b40ac6 100644
--- a/iOSClient/Supporting Files/gl.lproj/Localizable.strings
+++ b/iOSClient/Supporting Files/gl.lproj/Localizable.strings
Binary files differ
diff --git a/iOSClient/Supporting Files/he.lproj/Localizable.strings b/iOSClient/Supporting Files/he.lproj/Localizable.strings
index eeb920675..eb4be9bcb 100644
--- a/iOSClient/Supporting Files/he.lproj/Localizable.strings
+++ b/iOSClient/Supporting Files/he.lproj/Localizable.strings
Binary files differ
diff --git a/iOSClient/Supporting Files/hr.lproj/Localizable.strings b/iOSClient/Supporting Files/hr.lproj/Localizable.strings
index 0ecfef957..208bc95a6 100644
--- a/iOSClient/Supporting Files/hr.lproj/Localizable.strings
+++ b/iOSClient/Supporting Files/hr.lproj/Localizable.strings
Binary files differ
diff --git a/iOSClient/Supporting Files/hu.lproj/Localizable.strings b/iOSClient/Supporting Files/hu.lproj/Localizable.strings
index 4ac63d484..eb1168920 100644
--- a/iOSClient/Supporting Files/hu.lproj/Localizable.strings
+++ b/iOSClient/Supporting Files/hu.lproj/Localizable.strings
Binary files differ
diff --git a/iOSClient/Supporting Files/hy.lproj/Localizable.strings b/iOSClient/Supporting Files/hy.lproj/Localizable.strings
index eee3fd8bf..405da5c84 100644
--- a/iOSClient/Supporting Files/hy.lproj/Localizable.strings
+++ b/iOSClient/Supporting Files/hy.lproj/Localizable.strings
Binary files differ
diff --git a/iOSClient/Supporting Files/ia.lproj/Localizable.strings b/iOSClient/Supporting Files/ia.lproj/Localizable.strings
index 8bfc2fb2c..58db6229b 100644
--- a/iOSClient/Supporting Files/ia.lproj/Localizable.strings
+++ b/iOSClient/Supporting Files/ia.lproj/Localizable.strings
Binary files differ
diff --git a/iOSClient/Supporting Files/id.lproj/Localizable.strings b/iOSClient/Supporting Files/id.lproj/Localizable.strings
index 15b853679..4d3c04bf0 100644
--- a/iOSClient/Supporting Files/id.lproj/Localizable.strings
+++ b/iOSClient/Supporting Files/id.lproj/Localizable.strings
Binary files differ
diff --git a/iOSClient/Supporting Files/is.lproj/Localizable.strings b/iOSClient/Supporting Files/is.lproj/Localizable.strings
index c5e2e0f10..8c0cda331 100644
--- a/iOSClient/Supporting Files/is.lproj/Localizable.strings
+++ b/iOSClient/Supporting Files/is.lproj/Localizable.strings
Binary files differ
diff --git a/iOSClient/Supporting Files/it.lproj/Localizable.strings b/iOSClient/Supporting Files/it.lproj/Localizable.strings
index 1967875a5..deab17312 100644
--- a/iOSClient/Supporting Files/it.lproj/Localizable.strings
+++ b/iOSClient/Supporting Files/it.lproj/Localizable.strings
Binary files differ
diff --git a/iOSClient/Supporting Files/ja-JP.lproj/Localizable.strings b/iOSClient/Supporting Files/ja-JP.lproj/Localizable.strings
index 505b78ccd..a134b4d30 100644
--- a/iOSClient/Supporting Files/ja-JP.lproj/Localizable.strings
+++ b/iOSClient/Supporting Files/ja-JP.lproj/Localizable.strings
Binary files differ
diff --git a/iOSClient/Supporting Files/ka-GE.lproj/Localizable.strings b/iOSClient/Supporting Files/ka-GE.lproj/Localizable.strings
index feace17a1..a269d7f25 100644
--- a/iOSClient/Supporting Files/ka-GE.lproj/Localizable.strings
+++ b/iOSClient/Supporting Files/ka-GE.lproj/Localizable.strings
Binary files differ
diff --git a/iOSClient/Supporting Files/km.lproj/Localizable.strings b/iOSClient/Supporting Files/km.lproj/Localizable.strings
index a94ecc034..ae3aef67d 100644
--- a/iOSClient/Supporting Files/km.lproj/Localizable.strings
+++ b/iOSClient/Supporting Files/km.lproj/Localizable.strings
Binary files differ
diff --git a/iOSClient/Supporting Files/kn.lproj/Localizable.strings b/iOSClient/Supporting Files/kn.lproj/Localizable.strings
index 5cc4bbb0e..62e365314 100644
--- a/iOSClient/Supporting Files/kn.lproj/Localizable.strings
+++ b/iOSClient/Supporting Files/kn.lproj/Localizable.strings
Binary files differ
diff --git a/iOSClient/Supporting Files/ko.lproj/Localizable.strings b/iOSClient/Supporting Files/ko.lproj/Localizable.strings
index 23b475aff..b213ece67 100644
--- a/iOSClient/Supporting Files/ko.lproj/Localizable.strings
+++ b/iOSClient/Supporting Files/ko.lproj/Localizable.strings
Binary files differ
diff --git a/iOSClient/Supporting Files/lb.lproj/Localizable.strings b/iOSClient/Supporting Files/lb.lproj/Localizable.strings
index 9a8cf7a99..450ec211d 100644
--- a/iOSClient/Supporting Files/lb.lproj/Localizable.strings
+++ b/iOSClient/Supporting Files/lb.lproj/Localizable.strings
Binary files differ
diff --git a/iOSClient/Supporting Files/lo.lproj/Localizable.strings b/iOSClient/Supporting Files/lo.lproj/Localizable.strings
index b94b8cf9c..95da1c985 100644
--- a/iOSClient/Supporting Files/lo.lproj/Localizable.strings
+++ b/iOSClient/Supporting Files/lo.lproj/Localizable.strings
Binary files differ
diff --git a/iOSClient/Supporting Files/lt_LT.lproj/Localizable.strings b/iOSClient/Supporting Files/lt_LT.lproj/Localizable.strings
index b1ec86714..bcf28b68d 100644
--- a/iOSClient/Supporting Files/lt_LT.lproj/Localizable.strings
+++ b/iOSClient/Supporting Files/lt_LT.lproj/Localizable.strings
Binary files differ
diff --git a/iOSClient/Supporting Files/lv.lproj/Localizable.strings b/iOSClient/Supporting Files/lv.lproj/Localizable.strings
index 0fad65c4e..7441f743b 100644
--- a/iOSClient/Supporting Files/lv.lproj/Localizable.strings
+++ b/iOSClient/Supporting Files/lv.lproj/Localizable.strings
Binary files differ
diff --git a/iOSClient/Supporting Files/mk.lproj/Localizable.strings b/iOSClient/Supporting Files/mk.lproj/Localizable.strings
index 5f16d34b6..06197a01d 100644
--- a/iOSClient/Supporting Files/mk.lproj/Localizable.strings
+++ b/iOSClient/Supporting Files/mk.lproj/Localizable.strings
Binary files differ
diff --git a/iOSClient/Supporting Files/mn.lproj/Localizable.strings b/iOSClient/Supporting Files/mn.lproj/Localizable.strings
index 8993c3f4b..b10c73724 100644
--- a/iOSClient/Supporting Files/mn.lproj/Localizable.strings
+++ b/iOSClient/Supporting Files/mn.lproj/Localizable.strings
Binary files differ
diff --git a/iOSClient/Supporting Files/ms_MY.lproj/Localizable.strings b/iOSClient/Supporting Files/ms_MY.lproj/Localizable.strings
index 2b4117447..7b330424f 100644
--- a/iOSClient/Supporting Files/ms_MY.lproj/Localizable.strings
+++ b/iOSClient/Supporting Files/ms_MY.lproj/Localizable.strings
Binary files differ
diff --git a/iOSClient/Supporting Files/nb-NO.lproj/Localizable.strings b/iOSClient/Supporting Files/nb-NO.lproj/Localizable.strings
index fa92f16c5..28291f00b 100644
--- a/iOSClient/Supporting Files/nb-NO.lproj/Localizable.strings
+++ b/iOSClient/Supporting Files/nb-NO.lproj/Localizable.strings
Binary files differ
diff --git a/iOSClient/Supporting Files/nl.lproj/Localizable.strings b/iOSClient/Supporting Files/nl.lproj/Localizable.strings
index 435b5ba2b..6fcbd88e0 100644
--- a/iOSClient/Supporting Files/nl.lproj/Localizable.strings
+++ b/iOSClient/Supporting Files/nl.lproj/Localizable.strings
Binary files differ
diff --git a/iOSClient/Supporting Files/nn_NO.lproj/Localizable.strings b/iOSClient/Supporting Files/nn_NO.lproj/Localizable.strings
index 13b8687a5..541ea3073 100644
--- a/iOSClient/Supporting Files/nn_NO.lproj/Localizable.strings
+++ b/iOSClient/Supporting Files/nn_NO.lproj/Localizable.strings
Binary files differ
diff --git a/iOSClient/Supporting Files/oc.lproj/Localizable.strings b/iOSClient/Supporting Files/oc.lproj/Localizable.strings
index d86f34cfe..6473341e5 100644
--- a/iOSClient/Supporting Files/oc.lproj/Localizable.strings
+++ b/iOSClient/Supporting Files/oc.lproj/Localizable.strings
Binary files differ
diff --git a/iOSClient/Supporting Files/pl.lproj/Localizable.strings b/iOSClient/Supporting Files/pl.lproj/Localizable.strings
index 84c23aff1..8bf9630ba 100644
--- a/iOSClient/Supporting Files/pl.lproj/Localizable.strings
+++ b/iOSClient/Supporting Files/pl.lproj/Localizable.strings
Binary files differ
diff --git a/iOSClient/Supporting Files/pt-BR.lproj/Localizable.strings b/iOSClient/Supporting Files/pt-BR.lproj/Localizable.strings
index d43e461f6..c3d5351f5 100644
--- a/iOSClient/Supporting Files/pt-BR.lproj/Localizable.strings
+++ b/iOSClient/Supporting Files/pt-BR.lproj/Localizable.strings
Binary files differ
diff --git a/iOSClient/Supporting Files/pt-PT.lproj/Localizable.strings b/iOSClient/Supporting Files/pt-PT.lproj/Localizable.strings
index d15197e46..4f2f8d07b 100644
--- a/iOSClient/Supporting Files/pt-PT.lproj/Localizable.strings
+++ b/iOSClient/Supporting Files/pt-PT.lproj/Localizable.strings
Binary files differ
diff --git a/iOSClient/Supporting Files/ro.lproj/Localizable.strings b/iOSClient/Supporting Files/ro.lproj/Localizable.strings
index 67e31063a..ec7abd595 100644
--- a/iOSClient/Supporting Files/ro.lproj/Localizable.strings
+++ b/iOSClient/Supporting Files/ro.lproj/Localizable.strings
Binary files differ
diff --git a/iOSClient/Supporting Files/ru.lproj/Localizable.strings b/iOSClient/Supporting Files/ru.lproj/Localizable.strings
index fb526314d..25333d9df 100644
--- a/iOSClient/Supporting Files/ru.lproj/Localizable.strings
+++ b/iOSClient/Supporting Files/ru.lproj/Localizable.strings
Binary files differ
diff --git a/iOSClient/Supporting Files/sc.lproj/Localizable.strings b/iOSClient/Supporting Files/sc.lproj/Localizable.strings
index 9a6adabe2..74d7ba3aa 100644
--- a/iOSClient/Supporting Files/sc.lproj/Localizable.strings
+++ b/iOSClient/Supporting Files/sc.lproj/Localizable.strings
Binary files differ
diff --git a/iOSClient/Supporting Files/si.lproj/Localizable.strings b/iOSClient/Supporting Files/si.lproj/Localizable.strings
index 087ae5f8a..2cb5b9383 100644
--- a/iOSClient/Supporting Files/si.lproj/Localizable.strings
+++ b/iOSClient/Supporting Files/si.lproj/Localizable.strings
Binary files differ
diff --git a/iOSClient/Supporting Files/sk-SK.lproj/Localizable.strings b/iOSClient/Supporting Files/sk-SK.lproj/Localizable.strings
index d45a4630f..4a4d33945 100644
--- a/iOSClient/Supporting Files/sk-SK.lproj/Localizable.strings
+++ b/iOSClient/Supporting Files/sk-SK.lproj/Localizable.strings
Binary files differ
diff --git a/iOSClient/Supporting Files/sl.lproj/Localizable.strings b/iOSClient/Supporting Files/sl.lproj/Localizable.strings
index 6dcea0b95..d4a5412d4 100644
--- a/iOSClient/Supporting Files/sl.lproj/Localizable.strings
+++ b/iOSClient/Supporting Files/sl.lproj/Localizable.strings
Binary files differ
diff --git a/iOSClient/Supporting Files/sq.lproj/Localizable.strings b/iOSClient/Supporting Files/sq.lproj/Localizable.strings
index 0ad6b8b9f..e05d7efdf 100644
--- a/iOSClient/Supporting Files/sq.lproj/Localizable.strings
+++ b/iOSClient/Supporting Files/sq.lproj/Localizable.strings
Binary files differ
diff --git a/iOSClient/Supporting Files/sr.lproj/Localizable.strings b/iOSClient/Supporting Files/sr.lproj/Localizable.strings
index ca228840f..45cc83318 100644
--- a/iOSClient/Supporting Files/sr.lproj/Localizable.strings
+++ b/iOSClient/Supporting Files/sr.lproj/Localizable.strings
Binary files differ
diff --git a/iOSClient/Supporting Files/sr@latin.lproj/Localizable.strings b/iOSClient/Supporting Files/sr@latin.lproj/Localizable.strings
index 7504ff0cc..43f8e6e0a 100644
--- a/iOSClient/Supporting Files/sr@latin.lproj/Localizable.strings
+++ b/iOSClient/Supporting Files/sr@latin.lproj/Localizable.strings
Binary files differ
diff --git a/iOSClient/Supporting Files/sv.lproj/Localizable.strings b/iOSClient/Supporting Files/sv.lproj/Localizable.strings
index a3b9134a6..cf4f6ac5b 100644
--- a/iOSClient/Supporting Files/sv.lproj/Localizable.strings
+++ b/iOSClient/Supporting Files/sv.lproj/Localizable.strings
Binary files differ
diff --git a/iOSClient/Supporting Files/ta.lproj/Localizable.strings b/iOSClient/Supporting Files/ta.lproj/Localizable.strings
index fb0285e04..9c6c82fe2 100644
--- a/iOSClient/Supporting Files/ta.lproj/Localizable.strings
+++ b/iOSClient/Supporting Files/ta.lproj/Localizable.strings
Binary files differ
diff --git a/iOSClient/Supporting Files/th_TH.lproj/Localizable.strings b/iOSClient/Supporting Files/th_TH.lproj/Localizable.strings
index 278f49155..be1b5b782 100644
--- a/iOSClient/Supporting Files/th_TH.lproj/Localizable.strings
+++ b/iOSClient/Supporting Files/th_TH.lproj/Localizable.strings
Binary files differ
diff --git a/iOSClient/Supporting Files/tr.lproj/Localizable.strings b/iOSClient/Supporting Files/tr.lproj/Localizable.strings
index 87b54a431..ef6a51393 100644
--- a/iOSClient/Supporting Files/tr.lproj/Localizable.strings
+++ b/iOSClient/Supporting Files/tr.lproj/Localizable.strings
Binary files differ
diff --git a/iOSClient/Supporting Files/ug.lproj/Localizable.strings b/iOSClient/Supporting Files/ug.lproj/Localizable.strings
index 42bb90629..79cae4ae7 100644
--- a/iOSClient/Supporting Files/ug.lproj/Localizable.strings
+++ b/iOSClient/Supporting Files/ug.lproj/Localizable.strings
Binary files differ
diff --git a/iOSClient/Supporting Files/uk.lproj/Localizable.strings b/iOSClient/Supporting Files/uk.lproj/Localizable.strings
index 62adf19ff..948444a28 100644
--- a/iOSClient/Supporting Files/uk.lproj/Localizable.strings
+++ b/iOSClient/Supporting Files/uk.lproj/Localizable.strings
Binary files differ
diff --git a/iOSClient/Supporting Files/ur_PK.lproj/Localizable.strings b/iOSClient/Supporting Files/ur_PK.lproj/Localizable.strings
index 0962f4d2e..2ebb30831 100644
--- a/iOSClient/Supporting Files/ur_PK.lproj/Localizable.strings
+++ b/iOSClient/Supporting Files/ur_PK.lproj/Localizable.strings
Binary files differ
diff --git a/iOSClient/Supporting Files/vi.lproj/Localizable.strings b/iOSClient/Supporting Files/vi.lproj/Localizable.strings
index 6ca66d69d..d51feb60e 100644
--- a/iOSClient/Supporting Files/vi.lproj/Localizable.strings
+++ b/iOSClient/Supporting Files/vi.lproj/Localizable.strings
Binary files differ
diff --git a/iOSClient/Supporting Files/zh-Hans.lproj/Localizable.strings b/iOSClient/Supporting Files/zh-Hans.lproj/Localizable.strings
index 6916fcd11..cf93696a5 100644
--- a/iOSClient/Supporting Files/zh-Hans.lproj/Localizable.strings
+++ b/iOSClient/Supporting Files/zh-Hans.lproj/Localizable.strings
Binary files differ
diff --git a/iOSClient/Supporting Files/zh-Hant-TW.lproj/Localizable.strings b/iOSClient/Supporting Files/zh-Hant-TW.lproj/Localizable.strings
index c141a786a..412b9e082 100644
--- a/iOSClient/Supporting Files/zh-Hant-TW.lproj/Localizable.strings
+++ b/iOSClient/Supporting Files/zh-Hant-TW.lproj/Localizable.strings
Binary files differ
diff --git a/iOSClient/Supporting Files/zh_HK.lproj/Localizable.strings b/iOSClient/Supporting Files/zh_HK.lproj/Localizable.strings
index 3df6029cb..c6bdf933b 100644
--- a/iOSClient/Supporting Files/zh_HK.lproj/Localizable.strings
+++ b/iOSClient/Supporting Files/zh_HK.lproj/Localizable.strings
Binary files differ
diff --git a/iOSClient/Utility/CCUtility.h b/iOSClient/Utility/CCUtility.h
index 61c93fba1..e495637b4 100644
--- a/iOSClient/Utility/CCUtility.h
+++ b/iOSClient/Utility/CCUtility.h
@@ -178,6 +178,9 @@
+ (NSInteger)getChunkSize;
+ (void)setChunkSize:(NSInteger)size;
++ (NSInteger)getCleanUpDay;
++ (void)setCleanUpDay:(NSInteger)days;
+
// ===== Varius =====
+ (BOOL)addSkipBackupAttributeToItemAtURL:(NSURL *)URL;
@@ -264,5 +267,6 @@
+ (NSString *)getExtension:(NSString*)fileName;
+ (NSDate *)datetimeWithOutTime:(NSDate *)datDate;
+ (NSString *)valueForKey:(NSString *)key fromQueryItems:(NSArray *)queryItems;
++ (NSDate *)getATime:(const char *)path;
@end
diff --git a/iOSClient/Utility/CCUtility.m b/iOSClient/Utility/CCUtility.m
index d116bcd2d..8078f4fae 100644
--- a/iOSClient/Utility/CCUtility.m
+++ b/iOSClient/Utility/CCUtility.m
@@ -26,6 +26,8 @@
#import "NSNotificationCenter+MainThread.h"
#import <OpenSSL/OpenSSL.h>
#import <CoreLocation/CoreLocation.h>
+#include <sys/stat.h>
+
#define INTRO_MessageType @"MessageType_"
@@ -725,6 +727,23 @@
[UICKeyChainStore setString:sizeString forKey:@"chunkSize" service:NCGlobal.shared.serviceShareKeyChain];
}
++ (NSInteger)getCleanUpDay
+{
+ NSString *size = [UICKeyChainStore stringForKey:@"cleanUpDay" service:NCGlobal.shared.serviceShareKeyChain];
+
+ if (size == nil) {
+ return 0;
+ } else {
+ return [size integerValue];
+ }
+}
+
++ (void)setCleanUpDay:(NSInteger)days
+{
+ NSString *daysString = [@(days) stringValue];
+ [UICKeyChainStore setString:daysString forKey:@"cleanUpDay" service:NCGlobal.shared.serviceShareKeyChain];
+}
+
#pragma --------------------------------------------------------------------------------------------
#pragma mark ===== Various =====
#pragma --------------------------------------------------------------------------------------------
@@ -1128,12 +1147,12 @@
+ (NSString *)getDirectoryProviderStorageIconOcId:(NSString *)ocId etag:(NSString *)etag
{
- return [NSString stringWithFormat:@"%@/%@.small.ico", [self getDirectoryProviderStorageOcId:ocId], etag];
+ return [NSString stringWithFormat:@"%@/%@.small.%@", [self getDirectoryProviderStorageOcId:ocId], etag, [NCGlobal shared].extensionPreview];
}
+ (NSString *)getDirectoryProviderStoragePreviewOcId:(NSString *)ocId etag:(NSString *)etag
{
- return [NSString stringWithFormat:@"%@/%@.preview.ico", [self getDirectoryProviderStorageOcId:ocId], etag];
+ return [NSString stringWithFormat:@"%@/%@.preview.%@", [self getDirectoryProviderStorageOcId:ocId], etag, [NCGlobal shared].extensionPreview];
}
+ (BOOL)fileProviderStorageExists:(NSString *)ocId fileNameView:(NSString *)fileNameView
@@ -1831,4 +1850,12 @@
return queryItem.value;
}
++ (NSDate *)getATime:(const char *)path
+{
+ struct stat st;
+ stat(path, &st);
+ time_t accessed = st.st_atime;
+ NSDate *date = [NSDate dateWithTimeIntervalSince1970:accessed];
+ return date;
+}
@end
diff --git a/iOSClient/Utility/NCUtilityFileSystem.swift b/iOSClient/Utility/NCUtilityFileSystem.swift
index eced20314..0b6640de2 100644
--- a/iOSClient/Utility/NCUtilityFileSystem.swift
+++ b/iOSClient/Utility/NCUtilityFileSystem.swift
@@ -239,5 +239,58 @@ class NCUtilityFileSystem: NSObject {
return resultFileName
}
+
+ @objc func getDirectorySize(directory: String) -> Int64 {
+
+ let url = URL(fileURLWithPath: directory)
+ let manager = FileManager.default
+ var totalSize: Int64 = 0
+
+ if let enumerator = manager.enumerator(at: url, includingPropertiesForKeys: [.isRegularFileKey], options: []) {
+ for case let fileURL as URL in enumerator {
+ if let attributes = try? manager.attributesOfItem(atPath: fileURL.path) {
+ if let size = attributes[.size] as? Int64 {
+ totalSize = totalSize + size
+ }
+ }
+ }
+ }
+
+ return totalSize
+ }
+
+ func cleanUp(directory: String, days: TimeInterval) {
+
+ if days == 0 { return}
+
+ let minimumDate = Date().addingTimeInterval(-days*24*60*60)
+ let url = URL(fileURLWithPath: directory)
+
+ func meetsRequirement(date: Date) -> Bool {
+ return date < minimumDate
+ }
+
+ let manager = FileManager.default
+ if let enumerator = manager.enumerator(at: url, includingPropertiesForKeys: [.isRegularFileKey], options: []) {
+ for case let fileURL as URL in enumerator {
+ if let attributes = try? manager.attributesOfItem(atPath: fileURL.path) {
+ if let date = CCUtility.getATime(fileURL.path) {
+ if attributes[.size] as? Double == 0 { continue }
+ if attributes[.type] as? FileAttributeType == FileAttributeType.typeDirectory { continue }
+ if fileURL.pathExtension == NCGlobal.shared.extensionPreview { continue }
+ if meetsRequirement(date: date) {
+ let folderURL = fileURL.deletingLastPathComponent()
+ let ocId = folderURL.lastPathComponent
+ do {
+ try manager.removeItem(atPath: fileURL.path)
+ } catch { }
+ manager.createFile(atPath: fileURL.path, contents: nil, attributes: nil)
+ NCManageDatabase.shared.deleteLocalFile(predicate: NSPredicate(format: "ocId == %@", ocId))
+ }
+ }
+ }
+ }
+ }
+ }
}
diff --git a/iOSClient/Viewer/NCViewerImage/NCViewerImage.swift b/iOSClient/Viewer/NCViewerImage/NCViewerImage.swift
index a3a8db04e..9cf5a021f 100644
--- a/iOSClient/Viewer/NCViewerImage/NCViewerImage.swift
+++ b/iOSClient/Viewer/NCViewerImage/NCViewerImage.swift
@@ -67,9 +67,8 @@ class NCViewerImage: UIViewController {
override func viewDidLoad() {
super.viewDidLoad()
- view.backgroundColor = NCBrandColor.shared.systemBackground
- textColor = NCBrandColor.shared.label
-
+ navigationItem.rightBarButtonItem = UIBarButtonItem.init(image: UIImage(named: "more")!.image(color: NCBrandColor.shared.label, size: 25), style: .plain, target: self, action: #selector(self.openMenuMore))
+
singleTapGestureRecognizer = UITapGestureRecognizer(target: self, action: #selector(didSingleTapWith(gestureRecognizer:)))
panGestureRecognizer = UIPanGestureRecognizer(target: self, action: #selector(didPanWith(gestureRecognizer:)))
longtapGestureRecognizer = UILongPressGestureRecognizer()
@@ -104,20 +103,26 @@ class NCViewerImage: UIViewController {
progressView.progress = 0
setToolBar()
-
- navigationItem.rightBarButtonItem = UIBarButtonItem.init(image: UIImage(named: "more")!.image(color: NCBrandColor.shared.label, size: 25), style: .plain, target: self, action: #selector(self.openMenuMore))
-
- navigationController?.setNavigationBarHidden(false, animated: true)
- navigationController?.navigationBar.prefersLargeTitles = false
}
- override func viewWillDisappear(_ animated: Bool) {
- super.viewWillDisappear(animated)
+ override func viewWillAppear(_ animated: Bool) {
+ super.viewWillAppear(animated)
+
+ navigationController?.navigationBar.prefersLargeTitles = false
- if let navigationController = self.navigationController {
- if !navigationController.viewControllers.contains(self) {
- videoStop()
- }
+ if currentMode == .full {
+
+ navigationController?.setNavigationBarHidden(true, animated: false)
+ view.backgroundColor = .black
+ textColor = .white
+ progressView.isHidden = true
+
+ } else {
+
+ navigationController?.setNavigationBarHidden(false, animated: false)
+ view.backgroundColor = NCBrandColor.shared.systemBackground
+ textColor = NCBrandColor.shared.label
+ progressView.isHidden = false
}
}
@@ -131,6 +136,18 @@ class NCViewerImage: UIViewController {
NotificationCenter.default.addObserver(self, selector: #selector(downloadedFile(_:)), name: NSNotification.Name(rawValue: NCGlobal.shared.notificationCenterDownloadedFile), object: nil)
NotificationCenter.default.addObserver(self, selector: #selector(uploadedFile(_:)), name: NSNotification.Name(rawValue: NCGlobal.shared.notificationCenterUploadedFile), object: nil)
NotificationCenter.default.addObserver(self, selector: #selector(triggerProgressTask(_:)), name: NSNotification.Name(rawValue: NCGlobal.shared.notificationCenterProgressTask), object:nil)
+
+ NotificationCenter.default.addObserver(self, selector: #selector(applicationDidEnterBackground(_:)), name: NSNotification.Name(rawValue: NCGlobal.shared.notificationCenterApplicationDidEnterBackground), object: nil)
+ }
+
+ override func viewWillDisappear(_ animated: Bool) {
+ super.viewWillDisappear(animated)
+
+ if let navigationController = self.navigationController {
+ if !navigationController.viewControllers.contains(self) {
+ videoStop()
+ }
+ }
}
override func viewDidDisappear(_ animated: Bool) {
@@ -143,6 +160,8 @@ class NCViewerImage: UIViewController {
NotificationCenter.default.removeObserver(self, name: NSNotification.Name(rawValue: NCGlobal.shared.notificationCenterDownloadedFile), object: nil)
NotificationCenter.default.removeObserver(self, name: NSNotification.Name(rawValue: NCGlobal.shared.notificationCenterUploadedFile), object: nil)
NotificationCenter.default.removeObserver(self, name: NSNotification.Name(rawValue: NCGlobal.shared.notificationCenterProgressTask), object: nil)
+
+ NotificationCenter.default.removeObserver(self, name: NSNotification.Name(rawValue: NCGlobal.shared.notificationCenterApplicationDidEnterBackground), object: nil)
}
@objc func viewUnload() {
@@ -151,12 +170,20 @@ class NCViewerImage: UIViewController {
}
@objc func openMenuMore() {
+
let imageIcon = UIImage(contentsOfFile: CCUtility.getDirectoryProviderStorageIconOcId(currentMetadata.ocId, etag: currentMetadata.etag))
NCViewer.shared.toggleMenu(viewController: self, metadata: currentMetadata, webView: false, imageIcon: imageIcon)
}
//MARK: - NotificationCenter
+ @objc func applicationDidEnterBackground(_ notification: NSNotification) {
+
+ if currentMetadata.typeFile == NCGlobal.shared.metadataTypeFileVideo {
+ player?.pause()
+ }
+ }
+
@objc func downloadedFile(_ notification: NSNotification) {
if let userInfo = notification.userInfo as NSDictionary? {
@@ -346,8 +373,7 @@ class NCViewerImage: UIViewController {
image = UIImage.animatedImage(withAnimatedGIFURL: URL(fileURLWithPath: imagePath))
} else if ext == "SVG" {
if let svgImage = SVGKImage(contentsOfFile: imagePath) {
- let scale = Int(svgImage.size.height / svgImage.size.width)
- svgImage.size = CGSize(width: NCGlobal.shared.sizePreview, height: (NCGlobal.shared.sizePreview * scale))
+ svgImage.size = CGSize(width: NCGlobal.shared.sizePreview, height: NCGlobal.shared.sizePreview)
if let image = svgImage.uiImage {
if !FileManager().fileExists(atPath: previewPath) {
do {
@@ -385,7 +411,7 @@ class NCViewerImage: UIViewController {
if videoLayer != nil && currentViewerImageZoom != nil {
videoLayer!.frame = currentViewerImageZoom!.imageView.bounds
- videoLayer!.videoGravity = AVLayerVideoGravity.resizeAspectFill
+ videoLayer!.videoGravity = AVLayerVideoGravity.resizeAspect
currentViewerImageZoom!.imageView.layer.addSublayer(videoLayer!)
@@ -682,6 +708,7 @@ extension NCViewerImage: UIGestureRecognizerDelegate {
appDelegate.activeViewerVideo = NCViewerVideo()
appDelegate.activeViewerVideo?.metadata = currentMetadata
+ appDelegate.activeViewerVideo?.imageBackground = UIImage(named: "file_audio")
appDelegate.activeViewerVideo?.delegateViewerVideo = self
if let currentViewerVideo = appDelegate.activeViewerVideo {
present(currentViewerVideo, animated: false) { }
diff --git a/iOSClient/Viewer/NCViewerVideo/NCViewerVideo.swift b/iOSClient/Viewer/NCViewerVideo/NCViewerVideo.swift
index 1e4ae063f..ea11da93c 100644
--- a/iOSClient/Viewer/NCViewerVideo/NCViewerVideo.swift
+++ b/iOSClient/Viewer/NCViewerVideo/NCViewerVideo.swift
@@ -34,6 +34,7 @@ class NCViewerVideo: AVPlayerViewController {
let appDelegate = UIApplication.shared.delegate as! AppDelegate
var metadata = tableMetadata()
var pictureInPicture: Bool = false
+ var imageBackground: UIImage?
var delegateViewerVideo: NCViewerVideoDelegate?
private var rateObserverToken: Any?
@@ -53,6 +54,22 @@ class NCViewerVideo: AVPlayerViewController {
if let url = NCKTVHTTPCache.shared.getVideoURL(metadata: metadata) {
player = AVPlayer(url: url)
+
+ if metadata.typeFile == NCGlobal.shared.metadataTypeFileAudio {
+
+ let imageView = UIImageView.init(image: imageBackground)
+ imageView.translatesAutoresizingMaskIntoConstraints = false
+ contentOverlayView?.addSubview(imageView)
+
+ if let view = contentOverlayView {
+ NSLayoutConstraint.activate([
+ imageView.centerYAnchor.constraint(equalTo: view.centerYAnchor),
+ imageView.centerXAnchor.constraint(equalTo: view.centerXAnchor),
+ imageView.heightAnchor.constraint(equalToConstant: view.frame.height/3),
+ imageView.widthAnchor.constraint(equalToConstant: view.frame.height/3),
+ ])
+ }
+ }
// At end go back to start
NotificationCenter.default.addObserver(forName: .AVPlayerItemDidPlayToEndTime, object: player?.currentItem, queue: .main) { (notification) in
@@ -69,6 +86,13 @@ class NCViewerVideo: AVPlayerViewController {
}
player?.isMuted = CCUtility.getAudioMute()
}
+
+ // AIRPLAY
+ if CCUtility.fileProviderStorageExists(metadata.ocId, fileNameView: metadata.fileNameView) {
+ player?.allowsExternalPlayback = true
+ } else {
+ player?.allowsExternalPlayback = false
+ }
}
override func viewWillDisappear(_ animated: Bool) {