Skip to content

Commit

Permalink
V 5.0.0 (#2768)
Browse files Browse the repository at this point in the history
V 5.0.0
  • Loading branch information
marinofaggiana committed Feb 1, 2024
1 parent 6244f78 commit e51ce11
Show file tree
Hide file tree
Showing 198 changed files with 3,139 additions and 2,301 deletions.
4 changes: 2 additions & 2 deletions .swiftlint.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,8 +17,8 @@ function_body_length:
warning: 400

type_body_length:
warning: 1500
error: 2000
warning: 2000
error: 2500

file_length:
warning: 2000
Expand Down
2 changes: 1 addition & 1 deletion Brand/Database.swift
Original file line number Diff line number Diff line change
Expand Up @@ -26,4 +26,4 @@ import Foundation
// Database Realm
//
let databaseName = "nextcloud.realm"
let databaseSchemaVersion: UInt64 = 333
let databaseSchemaVersion: UInt64 = 340
6 changes: 4 additions & 2 deletions Brand/NCBrand.swift
Original file line number Diff line number Diff line change
Expand Up @@ -80,12 +80,14 @@ let userAgent: String = {
@objc public var disable_log: Bool = false
@objc public var disable_mobileconfig: Bool = false
@objc public var disable_show_more_nextcloud_apps_in_settings: Bool = false
@objc public var doNotAskPasscodeAtStartup: Bool = false

// Internal option behaviour
@objc public var cleanUpDay: Int = 0 // Set default "Delete, in the cache, all files older than" possible days value are: 0, 1, 7, 30, 90, 180, 365

// Max upload concurrent
public let maxConcurrentOperationUpload: Int = 10
// Max download/upload concurrent
public let maxConcurrentOperationDownload: Int = 5
public let maxConcurrentOperationUpload: Int = 5

// Number of failed attempts after reset app
@objc public let resetAppPasscodeAttempts: Int = 10
Expand Down
2 changes: 0 additions & 2 deletions ExternalResources/NCApplicationHandle.swift
Original file line number Diff line number Diff line change
Expand Up @@ -28,8 +28,6 @@ import Parchment

class NCApplicationHandle: NSObject {

let appDelegate = (UIApplication.shared.delegate as? AppDelegate)!

// class: AppDelegate
// func nextcloudPushNotificationAction(data: [String: AnyObject])
func nextcloudPushNotificationAction(data: [String: AnyObject]) -> [String: AnyObject]? {
Expand Down
2 changes: 1 addition & 1 deletion File Provider Extension/FileProviderEnumerator.swift
Original file line number Diff line number Diff line change
Expand Up @@ -174,7 +174,7 @@ class FileProviderEnumerator: NSObject, NSFileProviderEnumerator {

for metadata in metadatas! {

if metadata.e2eEncrypted || (!metadata.session.isEmpty && metadata.session != NCNetworking.shared.sessionIdentifierBackgroundExtension) { continue }
if metadata.e2eEncrypted || (!metadata.session.isEmpty && metadata.session != NCNetworking.shared.sessionUploadBackgroundExtension) { continue }

fpUtility.createocIdentifierOnFileSystem(metadata: metadata)

Expand Down
8 changes: 4 additions & 4 deletions File Provider Extension/FileProviderExtension.swift
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@ class FileProviderExtension: NSFileProviderExtension, NCNetworkingDelegate {
// Create directory File Provider Storage
_ = utilityFileSystem.directoryProviderStorage
// Configure URLSession
_ = NCNetworking.shared.sessionManagerBackgroundExtension
_ = NCNetworking.shared.sessionManagerUploadBackgroundExtension
}

deinit {
Expand Down Expand Up @@ -285,7 +285,7 @@ class FileProviderExtension: NSFileProviderExtension, NCNetworkingDelegate {
let serverUrlFileName = metadata.serverUrl + "/" + fileName
let fileNameLocalPath = url.path

if let task = NKBackground(nkCommonInstance: NextcloudKit.shared.nkCommonInstance).upload(serverUrlFileName: serverUrlFileName, fileNameLocalPath: fileNameLocalPath, dateCreationFile: nil, dateModificationFile: nil, description: metadata.ocId, session: NCNetworking.shared.sessionManagerBackgroundExtension) {
if let task = NKBackground(nkCommonInstance: NextcloudKit.shared.nkCommonInstance).upload(serverUrlFileName: serverUrlFileName, fileNameLocalPath: fileNameLocalPath, dateCreationFile: nil, dateModificationFile: nil, description: metadata.ocId, session: NCNetworking.shared.sessionManagerUploadBackgroundExtension) {

fileProviderData.shared.fileProviderManager.register(task, forItemWithIdentifier: NSFileProviderItemIdentifier(metadata.fileId)) { _ in }
}
Expand Down Expand Up @@ -356,7 +356,7 @@ class FileProviderExtension: NSFileProviderExtension, NCNetworkingDelegate {
fileURL.stopAccessingSecurityScopedResource()

let metadata = NCManageDatabase.shared.createMetadata(account: fileProviderData.shared.account, user: fileProviderData.shared.user, userId: fileProviderData.shared.userId, fileName: fileName, fileNameView: fileName, ocId: ocIdTemp, serverUrl: tableDirectory.serverUrl, urlBase: fileProviderData.shared.accountUrlBase, url: "", contentType: "")
metadata.session = NCNetworking.shared.sessionIdentifierBackgroundExtension
metadata.session = NCNetworking.shared.sessionUploadBackgroundExtension
metadata.size = size
metadata.status = NCGlobal.shared.metadataStatusUploading

Expand All @@ -365,7 +365,7 @@ class FileProviderExtension: NSFileProviderExtension, NCNetworkingDelegate {
let serverUrlFileName = tableDirectory.serverUrl + "/" + fileName
let fileNameLocalPath = self.utilityFileSystem.getDirectoryProviderStorageOcId(ocIdTemp, fileNameView: fileName)

if let task = NKBackground(nkCommonInstance: NextcloudKit.shared.nkCommonInstance).upload(serverUrlFileName: serverUrlFileName, fileNameLocalPath: fileNameLocalPath, dateCreationFile: nil, dateModificationFile: nil, description: ocIdTemp, session: NCNetworking.shared.sessionManagerBackgroundExtension) {
if let task = NKBackground(nkCommonInstance: NextcloudKit.shared.nkCommonInstance).upload(serverUrlFileName: serverUrlFileName, fileNameLocalPath: fileNameLocalPath, dateCreationFile: nil, dateModificationFile: nil, description: ocIdTemp, session: NCNetworking.shared.sessionManagerUploadBackgroundExtension) {

self.outstandingSessionTasks[URL(fileURLWithPath: fileNameLocalPath)] = task as URLSessionTask

Expand Down
Loading

0 comments on commit e51ce11

Please sign in to comment.