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 <ios@nextcloud.com>2022-08-09 18:56:12 +0300
committermarinofaggiana <ios@nextcloud.com>2022-08-09 18:56:12 +0300
commitfd646219864ddd810ab64a25ae73216b5660a8f0 (patch)
tree75a84836fbeac5f2bd372d4d31e289e04dcb1ff7
parent0b52bd69e8f065c59d2cf132b2c599a6f8a4356c (diff)
Improvement modify video
Signed-off-by: marinofaggiana <ios@nextcloud.com>
-rw-r--r--iOSClient/Menu/NCViewer+Menu.swift2
-rw-r--r--iOSClient/NCGlobal.swift2
-rw-r--r--iOSClient/Networking/NCNetworking.swift4
-rw-r--r--iOSClient/Networking/NCNetworkingChunkedUpload.swift2
-rw-r--r--iOSClient/Networking/NCNetworkingE2EE.swift2
-rw-r--r--iOSClient/Viewer/NCViewerMedia/NCViewerMediaPage.swift16
6 files changed, 22 insertions, 6 deletions
diff --git a/iOSClient/Menu/NCViewer+Menu.swift b/iOSClient/Menu/NCViewer+Menu.swift
index 160d9fef1..5f3483b12 100644
--- a/iOSClient/Menu/NCViewer+Menu.swift
+++ b/iOSClient/Menu/NCViewer+Menu.swift
@@ -244,7 +244,7 @@ extension NCViewer {
// MODIFY
//
if #available(iOS 13.0, *) {
- if !isFolderEncrypted && metadata.contentType != "image/gif" && (metadata.contentType == "com.adobe.pdf" || metadata.contentType == "application/pdf" || metadata.classFile == NCCommunicationCommon.typeClassFile.image.rawValue) {
+ if !isFolderEncrypted && metadata.contentType != "image/gif" && (metadata.contentType == "com.adobe.pdf" || metadata.contentType == "application/pdf" || metadata.classFile == NCCommunicationCommon.typeClassFile.image.rawValue || metadata.classFile == NCCommunicationCommon.typeClassFile.video.rawValue) {
actions.append(
NCMenuAction(
title: NSLocalizedString("_modify_", comment: ""),
diff --git a/iOSClient/NCGlobal.swift b/iOSClient/NCGlobal.swift
index a3c1ebc91..ed7f4d929 100644
--- a/iOSClient/NCGlobal.swift
+++ b/iOSClient/NCGlobal.swift
@@ -342,7 +342,7 @@ class NCGlobal: NSObject {
let notificationCenterDownloadedFile = "downloadedFile" // userInfo: ocId, serverUrl, account, selector, errorCode, errorDescription
let notificationCenterDownloadCancelFile = "downloadCancelFile" // userInfo: ocId, serverUrl, account
- let notificationCenterUploadStartFile = "uploadStartFile" // userInfo: ocId, serverUrl, account, fileName
+ let notificationCenterUploadStartFile = "uploadStartFile" // userInfo: ocId, serverUrl, account, fileName, sessionSelector
@objc let notificationCenterUploadedFile = "uploadedFile" // userInfo: ocId, serverUrl, account, fileName, ocIdTemp, errorCode, errorDescription
let notificationCenterUploadCancelFile = "uploadCancelFile" // userInfo: ocId, serverUrl, account
diff --git a/iOSClient/Networking/NCNetworking.swift b/iOSClient/Networking/NCNetworking.swift
index 7aca9e0c8..299c0e34e 100644
--- a/iOSClient/Networking/NCNetworking.swift
+++ b/iOSClient/Networking/NCNetworking.swift
@@ -430,7 +430,7 @@ import Photos
uploadTask = task
NCManageDatabase.shared.setMetadataSession(ocId: metadata.ocId, sessionError: "", sessionTaskIdentifier: task.taskIdentifier, status: NCGlobal.shared.metadataStatusUploading)
- NotificationCenter.default.postOnMainThread(name: NCGlobal.shared.notificationCenterUploadStartFile, userInfo: ["ocId": metadata.ocId, "serverUrl": metadata.serverUrl, "account": metadata.account, "fileName": metadata.fileName])
+ NotificationCenter.default.postOnMainThread(name: NCGlobal.shared.notificationCenterUploadStartFile, userInfo: ["ocId": metadata.ocId, "serverUrl": metadata.serverUrl, "account": metadata.account, "fileName": metadata.fileName, "sessionSelector": metadata.sessionSelector])
start()
}, progressHandler: { progress in
@@ -483,7 +483,7 @@ import Photos
if let task = NCCommunicationBackground.shared.upload(serverUrlFileName: serverUrlFileName, fileNameLocalPath: fileNameLocalPath, dateCreationFile: metadata.creationDate as Date, dateModificationFile: metadata.date as Date, description: metadata.ocId, session: session!) {
NCManageDatabase.shared.setMetadataSession(ocId: metadata.ocId, sessionError: "", sessionTaskIdentifier: task.taskIdentifier, status: NCGlobal.shared.metadataStatusUploading)
- NotificationCenter.default.postOnMainThread(name: NCGlobal.shared.notificationCenterUploadStartFile, userInfo: ["ocId": metadata.ocId, "serverUrl": metadata.serverUrl, "account": metadata.account, "fileName": metadata.fileName])
+ NotificationCenter.default.postOnMainThread(name: NCGlobal.shared.notificationCenterUploadStartFile, userInfo: ["ocId": metadata.ocId, "serverUrl": metadata.serverUrl, "account": metadata.account, "fileName": metadata.fileName, "sessionSelector": metadata.sessionSelector])
completion(0, "")
} else {
diff --git a/iOSClient/Networking/NCNetworkingChunkedUpload.swift b/iOSClient/Networking/NCNetworkingChunkedUpload.swift
index 2edf446c0..6335a8e5b 100644
--- a/iOSClient/Networking/NCNetworkingChunkedUpload.swift
+++ b/iOSClient/Networking/NCNetworkingChunkedUpload.swift
@@ -68,7 +68,7 @@ extension NCNetworking {
return
}
- NotificationCenter.default.postOnMainThread(name: NCGlobal.shared.notificationCenterUploadStartFile, userInfo: ["ocId": metadata.ocId, "serverUrl": metadata.serverUrl, "account": metadata.account, "fileName": metadata.fileName])
+ NotificationCenter.default.postOnMainThread(name: NCGlobal.shared.notificationCenterUploadStartFile, userInfo: ["ocId": metadata.ocId, "serverUrl": metadata.serverUrl, "account": metadata.account, "fileName": metadata.fileName, "sessionSelector": metadata.sessionSelector])
for fileName in filesNames {
diff --git a/iOSClient/Networking/NCNetworkingE2EE.swift b/iOSClient/Networking/NCNetworkingE2EE.swift
index f5c1dfe58..a12085b44 100644
--- a/iOSClient/Networking/NCNetworkingE2EE.swift
+++ b/iOSClient/Networking/NCNetworkingE2EE.swift
@@ -267,7 +267,7 @@ import Alamofire
NCNetworking.shared.uploadRequest[fileNameLocalPathRequest] = request
NCManageDatabase.shared.setMetadataSession(ocId: metadata.ocId, session: nil, sessionError: nil, sessionSelector: nil, sessionTaskIdentifier: nil, status: NCGlobal.shared.metadataStatusUploading)
- NotificationCenter.default.postOnMainThread(name: NCGlobal.shared.notificationCenterUploadStartFile, userInfo: ["ocId": metadata.ocId, "serverUrl": metadata.serverUrl, "account": metadata.account, "fileName": metadata.fileName])
+ NotificationCenter.default.postOnMainThread(name: NCGlobal.shared.notificationCenterUploadStartFile, userInfo: ["ocId": metadata.ocId, "serverUrl": metadata.serverUrl, "account": metadata.account, "fileName": metadata.fileName, "sessionSelector": metadata.sessionSelector])
}, taskHandler: { _ in
diff --git a/iOSClient/Viewer/NCViewerMedia/NCViewerMediaPage.swift b/iOSClient/Viewer/NCViewerMedia/NCViewerMediaPage.swift
index e41046944..c5911cd80 100644
--- a/iOSClient/Viewer/NCViewerMedia/NCViewerMediaPage.swift
+++ b/iOSClient/Viewer/NCViewerMedia/NCViewerMediaPage.swift
@@ -96,6 +96,7 @@ class NCViewerMediaPage: UIViewController {
NotificationCenter.default.addObserver(self, selector: #selector(downloadedFile(_:)), name: NSNotification.Name(rawValue: NCGlobal.shared.notificationCenterDownloadedFile), object: nil)
NotificationCenter.default.addObserver(self, selector: #selector(triggerProgressTask(_:)), name: NSNotification.Name(rawValue: NCGlobal.shared.notificationCenterProgressTask), object: nil)
+ NotificationCenter.default.addObserver(self, selector: #selector(uploadStartFile(_:)), name: NSNotification.Name(rawValue: NCGlobal.shared.notificationCenterUploadStartFile), object: nil)
NotificationCenter.default.addObserver(self, selector: #selector(uploadedFile(_:)), name: NSNotification.Name(rawValue: NCGlobal.shared.notificationCenterUploadedFile), object: nil)
NotificationCenter.default.addObserver(self, selector: #selector(hidePlayerToolBar(_:)), name: NSNotification.Name(rawValue: NCGlobal.shared.notificationCenterHidePlayerToolBar), object: nil)
@@ -115,6 +116,7 @@ class NCViewerMediaPage: UIViewController {
NotificationCenter.default.removeObserver(self, name: NSNotification.Name(rawValue: NCGlobal.shared.notificationCenterDownloadedFile), 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.notificationCenterUploadStartFile), 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.notificationCenterHidePlayerToolBar), object: nil)
@@ -232,6 +234,20 @@ class NCViewerMediaPage: UIViewController {
}
}
+ @objc func uploadStartFile(_ notification: NSNotification) {
+
+ guard let userInfo = notification.userInfo as NSDictionary?,
+ let serverUrl = userInfo["serverUrl"] as? String,
+ let fileName = userInfo["fileName"] as? String,
+ let sessionSelector = userInfo["sessionSelector"] as? String
+ else { return }
+
+ let metadata = metadatas[currentIndex]
+ if metadata.serverUrl == serverUrl, metadata.fileName == fileName, metadata.classFile == NCCommunicationCommon.typeClassFile.video.rawValue, sessionSelector == NCGlobal.shared.selectorUploadFileNODelete {
+
+ }
+ }
+
@objc func uploadedFile(_ notification: NSNotification) {
guard let userInfo = notification.userInfo as NSDictionary?,