NCUploadAssets.swift 26 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534
  1. //
  2. // NCUploadAssets.swift
  3. // Nextcloud
  4. //
  5. // Created by Marino Faggiana on 04/01/23.
  6. // Copyright © 2023 Marino Faggiana. All rights reserved.
  7. //
  8. // Author Marino Faggiana <marino.faggiana@nextcloud.com>
  9. //
  10. // This program is free software: you can redistribute it and/or modify
  11. // it under the terms of the GNU General Public License as published by
  12. // the Free Software Foundation, either version 3 of the License, or
  13. // (at your option) any later version.
  14. //
  15. // This program is distributed in the hope that it will be useful,
  16. // but WITHOUT ANY WARRANTY; without even the implied warranty of
  17. // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  18. // GNU General Public License for more details.
  19. //
  20. // You should have received a copy of the GNU General Public License
  21. // along with this program. If not, see <http://www.gnu.org/licenses/>.
  22. //
  23. import SwiftUI
  24. import NextcloudKit
  25. import TLPhotoPicker
  26. import Mantis
  27. import Photos
  28. import QuickLook
  29. class NCHostingUploadAssetsView: NSObject {
  30. func makeShipDetailsUI(assets: [TLPHAsset], serverUrl: String, userBaseUrl: NCUserBaseUrl) -> UIViewController {
  31. let uploadAssets = NCUploadAssets(assets: assets, serverUrl: serverUrl, userBaseUrl: userBaseUrl )
  32. let details = UploadAssetsView(uploadAssets: uploadAssets)
  33. return UIHostingController(rootView: details)
  34. }
  35. }
  36. // MARK: - Class
  37. struct PreviewStore {
  38. var id: String
  39. var image: UIImage
  40. var data: Data?
  41. var asset: TLPHAsset
  42. }
  43. class NCUploadAssets: NSObject, ObservableObject, NCCreateFormUploadConflictDelegate {
  44. @Published var serverUrl: String
  45. @Published var assets: [TLPHAsset]
  46. @Published var userBaseUrl: NCUserBaseUrl
  47. @Published var dismiss = false
  48. @Published var isUseAutoUploadFolder: Bool = false
  49. @Published var isUseAutoUploadSubFolder: Bool = false
  50. @Published var previewStore: [PreviewStore] = []
  51. @Published var showHUD: Bool = false
  52. @Published var uploadInProgress: Bool = false
  53. var metadatasNOConflict: [tableMetadata] = []
  54. var metadatasUploadInConflict: [tableMetadata] = []
  55. var timer: Timer?
  56. init(assets: [TLPHAsset], serverUrl: String, userBaseUrl: NCUserBaseUrl) {
  57. self.assets = assets
  58. self.serverUrl = serverUrl
  59. self.userBaseUrl = userBaseUrl
  60. }
  61. func loadImages() {
  62. DispatchQueue.global().async {
  63. for asset in self.assets {
  64. guard let image = asset.fullResolutionImage?.resizeImage(size: CGSize(width: 300, height: 300), isAspectRation: true), let localIdentifier = asset.phAsset?.localIdentifier else { continue }
  65. self.previewStore.append(PreviewStore(id: localIdentifier, image: image, asset: asset))
  66. }
  67. }
  68. }
  69. func startTimer(navigationItem: UINavigationItem) {
  70. self.timer = Timer.scheduledTimer(withTimeInterval: 0.5, repeats: true, block: { _ in
  71. guard let buttonDone = navigationItem.leftBarButtonItems?.first, let buttonCrop = navigationItem.leftBarButtonItems?.last else { return }
  72. buttonCrop.isEnabled = true
  73. buttonDone.isEnabled = true
  74. if let markup = navigationItem.rightBarButtonItems?.first(where: { $0.accessibilityIdentifier == "QLOverlayMarkupButtonAccessibilityIdentifier" }) {
  75. if let originalButton = markup.value(forKey: "originalButton") as AnyObject? {
  76. if let symbolImageName = originalButton.value(forKey: "symbolImageName") as? String {
  77. if symbolImageName == "pencil.tip.crop.circle.on" {
  78. buttonCrop.isEnabled = false
  79. buttonDone.isEnabled = false
  80. }
  81. }
  82. }
  83. }
  84. })
  85. }
  86. func stopTimer() {
  87. self.timer?.invalidate()
  88. }
  89. func dismissCreateFormUploadConflict(metadatas: [tableMetadata]?) {
  90. guard let metadatas = metadatas else {
  91. self.showHUD.toggle()
  92. self.uploadInProgress.toggle()
  93. return
  94. }
  95. func createProcessUploads() {
  96. if !self.dismiss {
  97. NCNetworkingProcessUpload.shared.createProcessUploads(metadatas: metadatas, completion: { _ in
  98. self.dismiss = true
  99. })
  100. }
  101. }
  102. if isUseAutoUploadFolder {
  103. DispatchQueue.global().async {
  104. let assets = self.assets.compactMap { $0.phAsset }
  105. let result = NCNetworking.shared.createFolder(assets: assets, selector: NCGlobal.shared.selectorUploadFile, useSubFolder: self.isUseAutoUploadSubFolder, account: self.userBaseUrl.account, urlBase: self.userBaseUrl.urlBase, userId: self.userBaseUrl.userId, withPush: false)
  106. DispatchQueue.main.async {
  107. self.showHUD.toggle()
  108. self.uploadInProgress.toggle()
  109. if result {
  110. createProcessUploads()
  111. } else {
  112. let error = NKError(errorCode: NCGlobal.shared.errorInternalError, errorDescription: "_error_createsubfolders_upload_")
  113. NCContentPresenter.shared.showError(error: error)
  114. }
  115. }
  116. }
  117. } else {
  118. createProcessUploads()
  119. }
  120. }
  121. }
  122. // MARK: - View
  123. struct UploadAssetsView: View {
  124. @State private var fileName: String = CCUtility.getFileNameMask(NCGlobal.shared.keyFileNameMask)
  125. @State private var isMaintainOriginalFilename: Bool = CCUtility.getOriginalFileName(NCGlobal.shared.keyFileNameOriginal)
  126. @State private var isAddFilenametype: Bool = CCUtility.getFileNameType(NCGlobal.shared.keyFileNameType)
  127. @State private var isPresentedSelect = false
  128. @State private var isPresentedUploadConflict = false
  129. @State private var isPresentedQuickLook = false
  130. @State private var fileNamePath = NSTemporaryDirectory() + "Photo.jpg"
  131. @State private var metadata: tableMetadata?
  132. @State private var index: Int = 0
  133. var gridItems: [GridItem] = [GridItem()]
  134. @ObservedObject var uploadAssets: NCUploadAssets
  135. @Environment(\.presentationMode) var presentationMode
  136. init(uploadAssets: NCUploadAssets) {
  137. self.uploadAssets = uploadAssets
  138. uploadAssets.loadImages()
  139. }
  140. func getOriginalFilename() -> String {
  141. CCUtility.setOriginalFileName(isMaintainOriginalFilename, key: NCGlobal.shared.keyFileNameOriginal)
  142. if let asset = uploadAssets.assets.first?.phAsset, let name = (asset.value(forKey: "filename") as? String) {
  143. return (name as NSString).deletingPathExtension
  144. } else {
  145. return ""
  146. }
  147. }
  148. func getTextServerUrl(_ serverUrl: String) -> String {
  149. if let directory = NCManageDatabase.shared.getTableDirectory(predicate: NSPredicate(format: "account == %@ AND serverUrl == %@", uploadAssets.userBaseUrl.account, serverUrl)), let metadata = NCManageDatabase.shared.getMetadataFromOcId(directory.ocId) {
  150. return (metadata.fileNameView)
  151. } else {
  152. return (serverUrl as NSString).lastPathComponent
  153. }
  154. }
  155. func setFileNameMask(fileName: String?) -> String {
  156. guard let asset = uploadAssets.assets.first?.phAsset else { return "" }
  157. var preview: String = ""
  158. let creationDate = asset.creationDate ?? Date()
  159. CCUtility.setOriginalFileName(isMaintainOriginalFilename, key: NCGlobal.shared.keyFileNameOriginal)
  160. CCUtility.setFileNameType(isAddFilenametype, key: NCGlobal.shared.keyFileNameType)
  161. if let fileName = fileName {
  162. let fileName = fileName.trimmingCharacters(in: CharacterSet.whitespacesAndNewlines)
  163. if !fileName.isEmpty {
  164. CCUtility.setFileNameMask(fileName, key: NCGlobal.shared.keyFileNameMask)
  165. preview = CCUtility.createFileName(asset.value(forKey: "filename") as? String,
  166. fileDate: creationDate, fileType: asset.mediaType,
  167. keyFileName: NCGlobal.shared.keyFileNameMask,
  168. keyFileNameType: NCGlobal.shared.keyFileNameType,
  169. keyFileNameOriginal: NCGlobal.shared.keyFileNameOriginal,
  170. forcedNewFileName: false)
  171. } else {
  172. CCUtility.setFileNameMask("", key: NCGlobal.shared.keyFileNameMask)
  173. preview = CCUtility.createFileName(asset.value(forKey: "filename") as? String,
  174. fileDate: creationDate,
  175. fileType: asset.mediaType,
  176. keyFileName: nil,
  177. keyFileNameType: NCGlobal.shared.keyFileNameType,
  178. keyFileNameOriginal: NCGlobal.shared.keyFileNameOriginal,
  179. forcedNewFileName: false)
  180. }
  181. } else {
  182. CCUtility.setFileNameMask("", key: NCGlobal.shared.keyFileNameMask)
  183. preview = CCUtility.createFileName(asset.value(forKey: "filename") as? String,
  184. fileDate: creationDate,
  185. fileType: asset.mediaType,
  186. keyFileName: nil,
  187. keyFileNameType: NCGlobal.shared.keyFileNameType,
  188. keyFileNameOriginal: NCGlobal.shared.keyFileNameOriginal,
  189. forcedNewFileName: false)
  190. }
  191. return String(format: NSLocalizedString("_preview_filename_", comment: ""), "MM, MMM, DD, YY, YYYY, HH, hh, mm, ss, ampm") + ":" + "\n\n" + (preview as NSString).deletingPathExtension
  192. }
  193. func save(completion: @escaping (_ metadatasNOConflict: [tableMetadata], _ metadatasUploadInConflict: [tableMetadata]) -> Void) {
  194. var metadatasNOConflict: [tableMetadata] = []
  195. var metadatasUploadInConflict: [tableMetadata] = []
  196. let autoUploadPath = NCManageDatabase.shared.getAccountAutoUploadPath(urlBase: uploadAssets.userBaseUrl.urlBase, userId: uploadAssets.userBaseUrl.userId, account: uploadAssets.userBaseUrl.account)
  197. var serverUrl = uploadAssets.isUseAutoUploadFolder ? autoUploadPath : uploadAssets.serverUrl
  198. for asset in uploadAssets.assets {
  199. guard let asset = asset.phAsset, let previewStore = uploadAssets.previewStore.first(where: { $0.id == asset.localIdentifier }) else { continue }
  200. var livePhoto: Bool = false
  201. let creationDate = asset.creationDate ?? Date()
  202. let fileName = CCUtility.createFileName(asset.value(forKey: "filename") as? String,
  203. fileDate: creationDate,
  204. fileType: asset.mediaType,
  205. keyFileName: NCGlobal.shared.keyFileNameMask,
  206. keyFileNameType: NCGlobal.shared.keyFileNameType,
  207. keyFileNameOriginal: NCGlobal.shared.keyFileNameOriginal,
  208. forcedNewFileName: false)!
  209. if asset.mediaSubtypes.contains(.photoLive) && CCUtility.getLivePhoto() && previewStore.data == nil {
  210. livePhoto = true
  211. }
  212. // Auto upload with subfolder
  213. if uploadAssets.isUseAutoUploadSubFolder {
  214. let dateFormatter = DateFormatter()
  215. dateFormatter.dateFormat = "yyyy"
  216. let yearString = dateFormatter.string(from: creationDate)
  217. dateFormatter.dateFormat = "MM"
  218. let monthString = dateFormatter.string(from: creationDate)
  219. serverUrl = autoUploadPath + "/" + yearString + "/" + monthString
  220. }
  221. // Check if is in upload
  222. let isRecordInSessions = NCManageDatabase.shared.getAdvancedMetadatas(predicate: NSPredicate(format: "account == %@ AND serverUrl == %@ AND fileName == %@ AND session != ''", uploadAssets.userBaseUrl.account, serverUrl, fileName), sorted: "fileName", ascending: false)
  223. if !isRecordInSessions.isEmpty { continue }
  224. let metadata = NCManageDatabase.shared.createMetadata(account: uploadAssets.userBaseUrl.account, user: uploadAssets.userBaseUrl.user, userId: uploadAssets.userBaseUrl.userId, fileName: fileName, fileNameView: fileName, ocId: NSUUID().uuidString, serverUrl: serverUrl, urlBase: uploadAssets.userBaseUrl.urlBase, url: "", contentType: "", isLivePhoto: livePhoto)
  225. metadata.assetLocalIdentifier = asset.localIdentifier
  226. metadata.session = NCNetworking.shared.sessionIdentifierBackground
  227. metadata.sessionSelector = NCGlobal.shared.selectorUploadFile
  228. metadata.status = NCGlobal.shared.metadataStatusWaitUpload
  229. // Modified
  230. if let previewStore = uploadAssets.previewStore.first(where: { $0.id == asset.localIdentifier }), let data = previewStore.data {
  231. if metadata.contentType == "image/heic" {
  232. let fileNameNoExtension = (fileName as NSString).deletingPathExtension
  233. metadata.contentType = "image/jpeg"
  234. metadata.fileName = fileNameNoExtension + ".jpg"
  235. metadata.fileNameView = fileNameNoExtension + ".jpg"
  236. }
  237. let fileNamePath = CCUtility.getDirectoryProviderStorageOcId(metadata.ocId, fileNameView: metadata.fileNameView)!
  238. do {
  239. try data.write(to: URL(fileURLWithPath: fileNamePath))
  240. metadata.isExtractFile = true
  241. metadata.size = NCUtilityFileSystem.shared.getFileSize(filePath: fileNamePath)
  242. metadata.creationDate = asset.creationDate as? NSDate ?? (Date() as NSDate)
  243. metadata.date = asset.modificationDate as? NSDate ?? (Date() as NSDate)
  244. } catch { }
  245. }
  246. if let result = NCManageDatabase.shared.getMetadataConflict(account: uploadAssets.userBaseUrl.account, serverUrl: serverUrl, fileNameView: fileName) {
  247. metadata.fileName = result.fileName
  248. metadatasUploadInConflict.append(metadata)
  249. } else {
  250. metadatasNOConflict.append(metadata)
  251. }
  252. }
  253. completion(metadatasNOConflict, metadatasUploadInConflict)
  254. }
  255. func presentedQuickLook(index: Int) {
  256. var image: UIImage?
  257. if let imageData = uploadAssets.previewStore[index].data {
  258. image = UIImage(data: imageData)
  259. } else if let imageFullResolution = uploadAssets.previewStore[index].asset.fullResolutionImage {
  260. image = imageFullResolution
  261. }
  262. if let image = image {
  263. if let data = image.pngData() {
  264. do {
  265. try data.write(to: URL(fileURLWithPath: fileNamePath))
  266. self.index = index
  267. isPresentedQuickLook = true
  268. } catch {
  269. }
  270. }
  271. }
  272. }
  273. var body: some View {
  274. NavigationView {
  275. ZStack(alignment: .top) {
  276. List {
  277. if !uploadAssets.previewStore.isEmpty {
  278. Section(header: Text(NSLocalizedString("_modify_photo_", comment: "")), footer: Text(NSLocalizedString("_modify_photo_desc_", comment: ""))) {
  279. ScrollView(.horizontal) {
  280. LazyHGrid(rows: gridItems, alignment: .center, spacing: 10) {
  281. ForEach(0..<uploadAssets.previewStore.count, id: \.self) { index in
  282. let item = uploadAssets.previewStore[index]
  283. ZStack(alignment: .bottomTrailing) {
  284. Image(uiImage: item.image)
  285. .resizable()
  286. .frame(width: 100, height: 100, alignment: .center)
  287. .cornerRadius(10)
  288. .scaledToFit()
  289. if item.asset.type == .livePhoto && item.data == nil {
  290. Image(systemName: "livephoto")
  291. .resizable()
  292. .scaledToFit()
  293. .frame(width: 15, height: 15)
  294. .foregroundColor(.white)
  295. .padding(.horizontal, 5)
  296. .padding(.vertical, 5)
  297. } else if item.asset.type == .video {
  298. Image(systemName: "video.fill")
  299. .resizable()
  300. .scaledToFit()
  301. .frame(width: 15, height: 15)
  302. .foregroundColor(.white)
  303. .padding(.horizontal, 5)
  304. .padding(.vertical, 5)
  305. }
  306. }
  307. .onTapGesture {
  308. if item.asset.type == .photo || item.asset.type == .livePhoto {
  309. presentedQuickLook(index: index)
  310. }
  311. }
  312. .fullScreenCover(isPresented: $isPresentedQuickLook) {
  313. ViewerQuickLook(url: URL(fileURLWithPath: fileNamePath), index: $index, isPresentedQuickLook: $isPresentedQuickLook, uploadAssets: uploadAssets)
  314. .ignoresSafeArea()
  315. }
  316. }
  317. }
  318. }
  319. }
  320. }
  321. Section {
  322. Toggle(isOn: $isMaintainOriginalFilename, label: {
  323. Text(NSLocalizedString("_maintain_original_filename_", comment: ""))
  324. .font(.system(size: 15))
  325. })
  326. .toggleStyle(SwitchToggleStyle(tint: Color(NCBrandColor.shared.brand)))
  327. if !isMaintainOriginalFilename {
  328. Toggle(isOn: $isAddFilenametype, label: {
  329. Text(NSLocalizedString("_add_filenametype_", comment: ""))
  330. .font(.system(size: 15))
  331. })
  332. .toggleStyle(SwitchToggleStyle(tint: Color(NCBrandColor.shared.brand)))
  333. }
  334. }
  335. .complexModifier { view in
  336. if #available(iOS 15, *) {
  337. view.listRowSeparator(.hidden)
  338. }
  339. }
  340. Section {
  341. Toggle(isOn: $uploadAssets.isUseAutoUploadFolder, label: {
  342. Text(NSLocalizedString("_use_folder_auto_upload_", comment: ""))
  343. .font(.system(size: 15))
  344. })
  345. .toggleStyle(SwitchToggleStyle(tint: Color(NCBrandColor.shared.brand)))
  346. if uploadAssets.isUseAutoUploadFolder {
  347. Toggle(isOn: $uploadAssets.isUseAutoUploadSubFolder, label: {
  348. Text(NSLocalizedString("_autoupload_create_subfolder_", comment: ""))
  349. .font(.system(size: 15))
  350. })
  351. .toggleStyle(SwitchToggleStyle(tint: Color(NCBrandColor.shared.brand)))
  352. }
  353. if !uploadAssets.isUseAutoUploadFolder {
  354. HStack {
  355. Label {
  356. if NCUtilityFileSystem.shared.getHomeServer(urlBase: uploadAssets.userBaseUrl.urlBase, userId: uploadAssets.userBaseUrl.userId) == uploadAssets.serverUrl {
  357. Text("/")
  358. .font(.system(size: 15))
  359. .frame(maxWidth: .infinity, alignment: .trailing)
  360. } else {
  361. Text(self.getTextServerUrl(uploadAssets.serverUrl))
  362. .font(.system(size: 15))
  363. .frame(maxWidth: .infinity, alignment: .trailing)
  364. }
  365. } icon: {
  366. Image("folder")
  367. .renderingMode(.template)
  368. .resizable()
  369. .scaledToFit()
  370. .foregroundColor(Color(NCBrandColor.shared.brand))
  371. }
  372. }
  373. .contentShape(Rectangle())
  374. .onTapGesture {
  375. isPresentedSelect = true
  376. }
  377. }
  378. }
  379. .complexModifier { view in
  380. if #available(iOS 15, *) {
  381. view.listRowSeparator(.hidden)
  382. }
  383. }
  384. Section {
  385. HStack {
  386. Text(NSLocalizedString("_filename_", comment: ""))
  387. if isMaintainOriginalFilename {
  388. Text(getOriginalFilename())
  389. .font(.system(size: 15))
  390. .frame(maxWidth: .infinity, alignment: .trailing)
  391. .foregroundColor(Color.gray)
  392. } else {
  393. TextField(NSLocalizedString("_enter_filename_", comment: ""), text: $fileName)
  394. .font(.system(size: 15))
  395. .modifier(TextFieldClearButton(text: $fileName))
  396. .multilineTextAlignment(.trailing)
  397. }
  398. }
  399. if !isMaintainOriginalFilename {
  400. Text(setFileNameMask(fileName: fileName))
  401. .font(.system(size: 11))
  402. .foregroundColor(Color.gray)
  403. }
  404. }
  405. .complexModifier { view in
  406. if #available(iOS 15, *) {
  407. view.listRowSeparator(.hidden)
  408. }
  409. }
  410. Button(NSLocalizedString("_save_", comment: "")) {
  411. uploadAssets.showHUD.toggle()
  412. uploadAssets.uploadInProgress.toggle()
  413. save { metadatasNOConflict, metadatasUploadInConflict in
  414. if metadatasUploadInConflict.isEmpty {
  415. uploadAssets.dismissCreateFormUploadConflict(metadatas: metadatasNOConflict)
  416. } else {
  417. uploadAssets.metadatasNOConflict = metadatasNOConflict
  418. uploadAssets.metadatasUploadInConflict = metadatasUploadInConflict
  419. isPresentedUploadConflict = true
  420. }
  421. }
  422. }
  423. .frame(maxWidth: .infinity)
  424. .buttonStyle(ButtonRounded(disabled: uploadAssets.uploadInProgress))
  425. .listRowBackground(Color(UIColor.systemGroupedBackground))
  426. .disabled(uploadAssets.uploadInProgress)
  427. }
  428. .navigationTitle(NSLocalizedString("_upload_photos_videos_", comment: ""))
  429. .navigationBarTitleDisplayMode(.inline)
  430. HUDView(showHUD: $uploadAssets.showHUD, textLabel: NSLocalizedString("_wait_", comment: ""), image: "doc.badge.arrow.up")
  431. .offset(y: uploadAssets.showHUD ? 5 : -200)
  432. .animation(.easeOut)
  433. }
  434. }
  435. .navigationViewStyle(StackNavigationViewStyle())
  436. .sheet(isPresented: $isPresentedSelect) {
  437. SelectView(serverUrl: $uploadAssets.serverUrl)
  438. }
  439. .sheet(isPresented: $isPresentedUploadConflict) {
  440. UploadConflictView(delegate: uploadAssets, serverUrl: uploadAssets.serverUrl, metadatasUploadInConflict: uploadAssets.metadatasUploadInConflict, metadatasNOConflict: uploadAssets.metadatasNOConflict)
  441. }
  442. .onReceive(uploadAssets.$dismiss) { newValue in
  443. if newValue {
  444. presentationMode.wrappedValue.dismiss()
  445. }
  446. }
  447. .onTapGesture {
  448. UIApplication.shared.windows.filter { $0.isKeyWindow }.first?.endEditing(true)
  449. }
  450. .onDisappear {
  451. uploadAssets.dismiss = true
  452. }
  453. }
  454. }
  455. // MARK: - Preview
  456. struct UploadAssetsView_Previews: PreviewProvider {
  457. static var previews: some View {
  458. if let appDelegate = UIApplication.shared.delegate as? AppDelegate {
  459. let uploadAssets = NCUploadAssets(assets: [], serverUrl: "/", userBaseUrl: appDelegate)
  460. UploadAssetsView(uploadAssets: uploadAssets)
  461. }
  462. }
  463. }