Skip to content

Commit

Permalink
NMC 2261 - Save audio screen update after removed by nextcloud versio…
Browse files Browse the repository at this point in the history
…n 5.0
  • Loading branch information
TSI-amrutwaghmare committed Apr 10, 2024
1 parent 909293c commit e3e4f01
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 13 deletions.
26 changes: 14 additions & 12 deletions iOSClient/AudioRecorder/NCAudioRecorderViewController.swift
Original file line number Diff line number Diff line change
Expand Up @@ -53,16 +53,14 @@ class NCAudioRecorderViewController: UIViewController, NCAudioRecorderDelegate {
contentContainerView.backgroundColor = UIColor.lightGray
voiceRecordHUD.fillColor = NCBrandColor.shared.progressColorGreen60

Task {
self.fileName = await NCNetworking.shared.createFileName(fileNameBase: NSLocalizedString("_untitled_", comment: "") + ".m4a", account: self.appDelegate.account, serverUrl: self.appDelegate.activeServerUrl)
recording = NCAudioRecorder(to: self.fileName)
recording.delegate = self
do {
try self.recording.prepare()
startStopLabel.text = NSLocalizedString("_voice_memo_start_", comment: "")
} catch {
print(error)
}
self.fileName = NCUtilityFileSystem().createFileNameDate(NSLocalizedString("_voice_memo_filename_", comment: ""), ext: "m4a")
recording = NCAudioRecorder(to: self.fileName)
recording.delegate = self
do {
try self.recording.prepare()
startStopLabel.text = NSLocalizedString("_voice_memo_start_", comment: "")
} catch {
print(error)
}
}

Expand All @@ -80,8 +78,12 @@ class NCAudioRecorderViewController: UIViewController, NCAudioRecorderDelegate {
if recording.state == .record {
recording.stop()
voiceRecordHUD.update(0.0)
dismiss(animated: true) {
self.uploadMetadata()
dismiss(animated: true) { [self] in
guard let navigationController = UIStoryboard(name: "NCCreateFormUploadVoiceNote", bundle: nil).instantiateInitialViewController() as? UINavigationController,
let viewController = navigationController.topViewController as? NCCreateFormUploadVoiceNote else { return }
navigationController.modalPresentationStyle = .formSheet
viewController.setup(serverUrl: self.appDelegate.activeServerUrl, fileNamePath: NSTemporaryDirectory() + self.fileName, fileName: self.fileName)
self.appDelegate.window?.rootViewController?.present(navigationController, animated: true)
}
} else {
do {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -273,7 +273,7 @@ class NCCreateFormUploadVoiceNote: XLFormViewController, NCSelectDelegate, AVAud

utilityFileSystem.copyFile(atPath: self.fileNamePath, toPath: utilityFileSystem.getDirectoryProviderStorageOcId(metadata.ocId, fileNameView: metadata.fileNameView))

NCNetworkingProcessUpload.shared.createProcessUploads(metadatas: [metadata], completion: { _ in })
NCNetworkingProcess.shared.createProcessUploads(metadatas: [metadata], completion: { _ in })

self.dismiss(animated: true, completion: nil)
}
Expand Down

0 comments on commit e3e4f01

Please sign in to comment.