Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
78 commits
Select commit Hold shift + click to select a range
88327b3
cod
marinofaggiana Oct 6, 2025
b673b21
code
marinofaggiana Oct 6, 2025
5171002
code
marinofaggiana Oct 6, 2025
49edb28
cod
marinofaggiana Oct 6, 2025
06b5763
cod
marinofaggiana Oct 6, 2025
041d88e
normalized
marinofaggiana Oct 6, 2025
b01dfe5
cod
marinofaggiana Oct 6, 2025
942d3c9
flush metadata
marinofaggiana Oct 6, 2025
ef2956f
cod
marinofaggiana Oct 6, 2025
72ba602
Update NCUploadStore.swift
marinofaggiana Oct 6, 2025
3954275
clean
marinofaggiana Oct 6, 2025
68d62b9
Update NCUploadStore.swift
marinofaggiana Oct 6, 2025
7d5708f
Update NCUploadStore.swift
marinofaggiana Oct 6, 2025
dc34dbb
code
marinofaggiana Oct 6, 2025
7736e65
Update NCUploadStore.swift
marinofaggiana Oct 6, 2025
6e1d76c
test
marinofaggiana Oct 7, 2025
9a6bea4
cod
marinofaggiana Oct 7, 2025
3793502
rename to TransferItem
marinofaggiana Oct 7, 2025
ef267bc
improvements
marinofaggiana Oct 7, 2025
1ae1868
code
marinofaggiana Oct 7, 2025
930852e
cod
marinofaggiana Oct 7, 2025
18b3715
fix
marinofaggiana Oct 7, 2025
49c882b
Merge branch 'master' into uploadItem
marinofaggiana Oct 7, 2025
10f75e7
disabled
marinofaggiana Oct 7, 2025
785e561
Merge pull request #3812 from nextcloud/uploadItem
marinofaggiana Oct 7, 2025
308e856
fix
marinofaggiana Oct 7, 2025
367b663
improved
marinofaggiana Oct 7, 2025
910fb88
Update NCNetworking+Download.swift
marinofaggiana Oct 7, 2025
f24649c
fix(l10n): Update translations from Transifex
nextcloud-bot Oct 8, 2025
e55f00f
nmc 2023 - privacy policy localization changes added
TSI-amrutwaghmare May 10, 2023
65ca207
NMC 2023 german translation update (+35 squashed commits)
TSI-amrutwaghmare May 10, 2023
401a1bd
nmc 2023 - scan cluster localisation changes
TSI-amrutwaghmare May 19, 2023
de61a4a
nmc 2023 - sharing feature localisation strings update
TSI-amrutwaghmare Jun 6, 2023
57b9932
nmc 2023 - localisation update for share text field
TSI-amrutwaghmare Jun 7, 2023
2e50d18
NMC 2023 - update missing localised strings for german languages
TSI-amrutwaghmare Feb 27, 2024
2c0db8c
nmc 2023 - privacy policy localization changes added
TSI-amrutwaghmare May 10, 2023
db99716
NMC 1990 Settings cluster Localization strings added
TSI-shwetawaikar May 11, 2023
ab03baf
nmc 2023 - E2e and onboarding Internet not available strings update
TSI-amrutwaghmare May 24, 2023
63e532e
nmc 2023 - sharing feature localisation strings update
TSI-amrutwaghmare Jun 6, 2023
6f2d9f2
nmc 2023 - localisation update for share text field
TSI-amrutwaghmare Jun 7, 2023
8d08407
nmc 2023 - more tab localisation changes
TSI-amrutwaghmare Jun 9, 2023
526ce2b
nmc 2023 - image video upload localisation related changes
TSI-amrutwaghmare Jun 12, 2023
5d30027
NMC 2023 "Details" string changed
TSI-shwetawaikar Jun 23, 2023
fd3c684
NMC 2023 - share strings update
TSI-amrutwaghmare Jun 24, 2023
e8181a2
NMC 2023 - (nmc 2397) Strings update
TSI-amrutwaghmare Jul 11, 2023
3c28a27
NMC 2023 - Localisation changes for auto upload description
TSI-amrutwaghmare Dec 26, 2023
3f7a820
NMC 2023 - update missing localised strings for german languages
TSI-amrutwaghmare Feb 27, 2024
297e536
NMC 2023 german translation update
TSI-amrutwaghmare Aug 26, 2024
ab67ed8
NMC 2023 - update missing localised strings for english and german la…
harshada-15-tsys Apr 7, 2025
0d9c8d3
NMC 2023 - Updated missing localised strings for English and DE language
harshada-15-tsys Apr 16, 2025
cf3642a
NMC-2023 - Localizations for EN and DE updated for New sharing design…
harshada-15-tsys Sep 30, 2025
51d450d
doc
marinofaggiana Oct 8, 2025
3ffb34e
cod
marinofaggiana Oct 8, 2025
08f7044
cod
marinofaggiana Oct 8, 2025
7a47c2a
Merge pull request #3813 from nextcloud/TransferStore
marinofaggiana Oct 8, 2025
c654433
nmc 2023 - privacy policy localization changes added
TSI-amrutwaghmare May 10, 2023
af87b75
NMC 2023 german translation update (+35 squashed commits)
TSI-amrutwaghmare May 10, 2023
6726d99
nmc 2023 - scan cluster localisation changes
TSI-amrutwaghmare May 19, 2023
f52e432
nmc 2023 - sharing feature localisation strings update
TSI-amrutwaghmare Jun 6, 2023
3fe33aa
nmc 2023 - localisation update for share text field
TSI-amrutwaghmare Jun 7, 2023
8700080
NMC 2023 - update missing localised strings for german languages
TSI-amrutwaghmare Feb 27, 2024
a99070d
nmc 2023 - privacy policy localization changes added
TSI-amrutwaghmare May 10, 2023
e982c3a
NMC 1990 Settings cluster Localization strings added
TSI-shwetawaikar May 11, 2023
c46af24
nmc 2023 - E2e and onboarding Internet not available strings update
TSI-amrutwaghmare May 24, 2023
0c719d3
nmc 2023 - sharing feature localisation strings update
TSI-amrutwaghmare Jun 6, 2023
b40871e
nmc 2023 - localisation update for share text field
TSI-amrutwaghmare Jun 7, 2023
40e9a4f
nmc 2023 - more tab localisation changes
TSI-amrutwaghmare Jun 9, 2023
b26299e
nmc 2023 - image video upload localisation related changes
TSI-amrutwaghmare Jun 12, 2023
3a19618
NMC 2023 "Details" string changed
TSI-shwetawaikar Jun 23, 2023
7d34553
NMC 2023 - share strings update
TSI-amrutwaghmare Jun 24, 2023
76081da
NMC 2023 - (nmc 2397) Strings update
TSI-amrutwaghmare Jul 11, 2023
8a97f3a
NMC 2023 - Localisation changes for auto upload description
TSI-amrutwaghmare Dec 26, 2023
29d4c11
NMC 2023 - update missing localised strings for german languages
TSI-amrutwaghmare Feb 27, 2024
768066e
NMC 2023 german translation update
TSI-amrutwaghmare Aug 26, 2024
d75edfb
NMC 2023 - update missing localised strings for english and german la…
harshada-15-tsys Apr 7, 2025
904f220
NMC 2023 - Updated missing localised strings for English and DE language
harshada-15-tsys Apr 16, 2025
1a20ba5
NMC-2023 - Localizations for EN and DE updated for New sharing design…
harshada-15-tsys Sep 30, 2025
077b2ca
Merge branch 'nmc/2023-localization' of https://github.com/nextmcloud…
harshada-15-tsys Oct 8, 2025
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion Brand/Database.swift
Original file line number Diff line number Diff line change
Expand Up @@ -8,5 +8,5 @@ import Foundation
//
let databaseName = "nextcloud.realm"
let tableAccountBackup = "tableAccountBackup.json"
let fileUploadStore = "uploads.json"
let fileTransferStore = "transfer.json"
let databaseSchemaVersion: UInt64 = 403
4 changes: 2 additions & 2 deletions File Provider Extension/FileProviderData.swift
Original file line number Diff line number Diff line change
Expand Up @@ -164,7 +164,7 @@ class FileProviderData: NSObject {

if error == .success {
if let metadata = await self.database.getMetadataFromOcIdAsync(ocId) {
await self.database.addLocalFileAsync(metadata: metadata)
await self.database.addLocalFilesAsync(metadatas: [metadata])
}
}

Expand Down Expand Up @@ -228,7 +228,7 @@ class FileProviderData: NSObject {
metadata.status = NCGlobal.shared.metadataStatusNormal

await self.database.addMetadataAsync(metadata)
await self.database.addLocalFileAsync(metadata: metadata)
await self.database.addLocalFilesAsync(metadatas: [metadata])

await signalEnumerator(ocId: ocId, type: .update)

Expand Down
4 changes: 4 additions & 0 deletions Nextcloud.xcodeproj/project.pbxproj
Original file line number Diff line number Diff line change
Expand Up @@ -722,6 +722,7 @@
F7864AD02A78FE73004870E0 /* NCManageDatabase+LocalFile.swift in Sources */ = {isa = PBXBuildFile; fileRef = F7864ACB2A78FE73004870E0 /* NCManageDatabase+LocalFile.swift */; };
F7864AD12A78FE73004870E0 /* NCManageDatabase+LocalFile.swift in Sources */ = {isa = PBXBuildFile; fileRef = F7864ACB2A78FE73004870E0 /* NCManageDatabase+LocalFile.swift */; };
F7864AD22A78FE73004870E0 /* NCManageDatabase+LocalFile.swift in Sources */ = {isa = PBXBuildFile; fileRef = F7864ACB2A78FE73004870E0 /* NCManageDatabase+LocalFile.swift */; };
F786891D2E93A9DF000E39B3 /* NCTransferStore.swift in Sources */ = {isa = PBXBuildFile; fileRef = F78689192E93A9D5000E39B3 /* NCTransferStore.swift */; };
F787704F22E7019900F287A9 /* NCShareLinkCell.xib in Resources */ = {isa = PBXBuildFile; fileRef = F787704E22E7019900F287A9 /* NCShareLinkCell.xib */; };
F787AC09298BCB4A0001BB00 /* SVGKitSwift in Frameworks */ = {isa = PBXBuildFile; productRef = F787AC08298BCB4A0001BB00 /* SVGKitSwift */; };
F787AC0B298BCB540001BB00 /* SVGKitSwift in Frameworks */ = {isa = PBXBuildFile; productRef = F787AC0A298BCB540001BB00 /* SVGKitSwift */; };
Expand Down Expand Up @@ -1656,6 +1657,7 @@
F785129A2D79899E0087DDD0 /* NCNetworking+TermsOfService.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = "NCNetworking+TermsOfService.swift"; sourceTree = "<group>"; };
F785EE9C246196DF00B3F945 /* NCNetworkingE2EE.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = NCNetworkingE2EE.swift; sourceTree = "<group>"; };
F7864ACB2A78FE73004870E0 /* NCManageDatabase+LocalFile.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = "NCManageDatabase+LocalFile.swift"; sourceTree = "<group>"; };
F78689192E93A9D5000E39B3 /* NCTransferStore.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = NCTransferStore.swift; sourceTree = "<group>"; };
F787704E22E7019900F287A9 /* NCShareLinkCell.xib */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = file.xib; path = NCShareLinkCell.xib; sourceTree = "<group>"; };
F78A10BE29322E8A008499B8 /* NCManageDatabase+Directory.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = "NCManageDatabase+Directory.swift"; sourceTree = "<group>"; };
F78A18B523CDD07D00F681F3 /* NCViewerRichWorkspaceWebView.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = NCViewerRichWorkspaceWebView.swift; sourceTree = "<group>"; };
Expand Down Expand Up @@ -2539,6 +2541,7 @@
F70D8D8024A4A9BF000A5756 /* NCNetworkingProcess.swift */,
F755BD9A20594AC7008C5FBB /* NCService.swift */,
F7A3DB8F2DDE238C008F7EC8 /* NCDebouncer.swift */,
F78689192E93A9D5000E39B3 /* NCTransferStore.swift */,
);
path = Networking;
sourceTree = "<group>";
Expand Down Expand Up @@ -4700,6 +4703,7 @@
F7A3DB932DDE23B5008F7EC8 /* NCDebouncer.swift in Sources */,
F72CD63A25C19EBF00F46F9A /* NCAutoUpload.swift in Sources */,
AF93471D27E2361E002537EE /* NCShareAdvancePermissionFooter.swift in Sources */,
F786891D2E93A9DF000E39B3 /* NCTransferStore.swift in Sources */,
AF1A9B6427D0CA1E00F17A9E /* UIAlertController+Extension.swift in Sources */,
F7FA80012C0F4F3B0072FC60 /* NCUploadAssetsView.swift in Sources */,
371B5A2E23D0B04500FAFAE9 /* NCMenu.swift in Sources */,
Expand Down
63 changes: 39 additions & 24 deletions iOSClient/Data/NCManageDatabase+LocalFile.swift
Original file line number Diff line number Diff line change
Expand Up @@ -29,35 +29,50 @@ extension NCManageDatabase {

// MARK: - Realm Write

/// Adds or updates multiple local file entries corresponding to the given metadata array.
/// Uses async Realm read + single write transaction. Assumes `tableLocalFile` has a primary key.
/// - Parameters:
/// - metadata: The `tableMetadata` containing file details.
/// - offline: Optional flag to mark the file as available offline.
/// - Returns: Nothing. Realm write is performed asynchronously.
func addLocalFileAsync(metadata: tableMetadata, offline: Bool? = nil) async {
// Read (non-blocking): safely detach from Realm thread
let existing: tableLocalFile? = performRealmRead { realm in
realm.objects(tableLocalFile.self)
.filter(NSPredicate(format: "ocId == %@", metadata.ocId))
.first
.map { tableLocalFile(value: $0) }
/// - metadatas: Array of `tableMetadata` to map into `tableLocalFile`.
/// - offline: Optional override for the `offline` flag applied to all items.
func addLocalFilesAsync(metadatas: [tableMetadata], offline: Bool? = nil) async {
guard !metadatas.isEmpty else {
return
}

// Extract ocIds for efficient lookup
let ocIds = metadatas.compactMap { $0.ocId }
guard !ocIds.isEmpty else {
return
}

// Preload existing entries to avoid creating duplicates
let existingMap: [String: tableLocalFile] = await performRealmReadAsync { realm in
let existing = realm.objects(tableLocalFile.self)
.filter(NSPredicate(format: "ocId IN %@", ocIds))
return Dictionary(uniqueKeysWithValues:
existing.map { ($0.ocId, tableLocalFile(value: $0)) } // detached copy via value init
)
} ?? [:]

await performRealmWriteAsync { realm in
let addObject = existing ?? tableLocalFile()

addObject.account = metadata.account
addObject.etag = metadata.etag
addObject.exifDate = NSDate()
addObject.exifLatitude = "-1"
addObject.exifLongitude = "-1"
addObject.ocId = metadata.ocId
addObject.fileName = metadata.fileName

if let offline {
addObject.offline = offline
}
for metadata in metadatas {
// Reuse existing object or create a new one
let local = existingMap[metadata.ocId] ?? tableLocalFile()

local.account = metadata.account
local.etag = metadata.etag
local.exifDate = NSDate()
local.exifLatitude = "-1"
local.exifLongitude = "-1"
local.ocId = metadata.ocId
local.fileName = metadata.fileName

if let offline {
local.offline = offline
}

realm.add(addObject, update: .all)
realm.add(local, update: .all)
}
}
}

Expand Down
13 changes: 13 additions & 0 deletions iOSClient/Data/NCManageDatabase+Metadata.swift
Original file line number Diff line number Diff line change
Expand Up @@ -473,6 +473,19 @@ extension NCManageDatabase {
}
}

func replaceMetadataAsync(ocIdTransfers: [String], metadatas: [tableMetadata]) async {
guard !ocIdTransfers.isEmpty else {
return
}

await performRealmWriteAsync { realm in
let result = realm.objects(tableMetadata.self)
.filter("ocIdTransfer IN %@", ocIdTransfers, ocIdTransfers)
realm.delete(result)
realm.add(metadatas, update: .all)
}
}

// Asynchronously deletes an array of `tableMetadata` entries from the Realm database.
/// - Parameter metadatas: The `tableMetadata` objects to be deleted.
func deleteMetadatasAsync(_ metadatas: [tableMetadata]) async {
Expand Down
16 changes: 8 additions & 8 deletions iOSClient/Files/NCFiles+SyncMetadata.swift
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ extension NCFiles {
// If a sync task is already running, do not start a new one
if let task = syncMetadatasTask,
!task.isCancelled {
nkLog(tag: global.logSpeedUpSyncMetadata, emoji: .info, message: "Exit: Another sync is already running. Skipping this one.", consoleOnly: true)
nkLog(tag: global.logTagSpeedUpSyncMetadata, emoji: .info, message: "Exit: Another sync is already running. Skipping this one.", consoleOnly: true)
return
}

Expand All @@ -42,9 +42,9 @@ extension NCFiles {
func stopSyncMetadata() {
if let task = syncMetadatasTask {
if task.isCancelled {
nkLog(tag: global.logSpeedUpSyncMetadata, emoji: .stop, message: "Sync Metadata for \(self.serverUrl) was already cancelled.", consoleOnly: true)
nkLog(tag: global.logTagSpeedUpSyncMetadata, emoji: .stop, message: "Sync Metadata for \(self.serverUrl) was already cancelled.", consoleOnly: true)
} else {
nkLog(tag: global.logSpeedUpSyncMetadata, emoji: .stop, message: "Stopping active Sync Metadata for \(self.serverUrl).", consoleOnly: true)
nkLog(tag: global.logTagSpeedUpSyncMetadata, emoji: .stop, message: "Stopping active Sync Metadata for \(self.serverUrl).", consoleOnly: true)
}
}

Expand All @@ -71,7 +71,7 @@ extension NCFiles {
return
}
let identifier = self.serverUrl + "_syncMetadata"
nkLog(tag: global.logSpeedUpSyncMetadata, emoji: .start, message: "Start Sync Metadata for \(self.serverUrl)")
nkLog(tag: global.logTagSpeedUpSyncMetadata, emoji: .start, message: "Start Sync Metadata for \(self.serverUrl)")

// Always cancel and clear all tracked URLSessionTask on any exit path
defer {
Expand All @@ -82,7 +82,7 @@ extension NCFiles {

// If a readFile for this serverUrl is already in-flight, do nothing
if await networking.networkingTasks.isReading(identifier: identifier) {
nkLog(tag: global.logSpeedUpSyncMetadata, emoji: .debug, message: "ReadFile for this \(self.serverUrl) is already in-flight.", consoleOnly: true)
nkLog(tag: global.logTagSpeedUpSyncMetadata, emoji: .debug, message: "ReadFile for this \(self.serverUrl) is already in-flight.", consoleOnly: true)
return
}

Expand All @@ -103,7 +103,7 @@ extension NCFiles {
guard resultsReadFile.error == .success,
let metadata = resultsReadFile.metadata,
!metadata.e2eEncrypted else {
nkLog(tag: global.logSpeedUpSyncMetadata, emoji: .info, message: "Exit: result error \(resultsReadFile.error.errorDescription) or e2ee directory \(resultsReadFile.metadata?.e2eEncrypted ?? false). Skipping this one.")
nkLog(tag: global.logTagSpeedUpSyncMetadata, emoji: .info, message: "Exit: result error \(resultsReadFile.error.errorDescription) or e2ee directory \(resultsReadFile.metadata?.e2eEncrypted ?? false). Skipping this one.")
return
}

Expand Down Expand Up @@ -131,9 +131,9 @@ extension NCFiles {

// If this folder failed, skip it but keep processing others
if resultsReadFolder.error == .success {
nkLog(tag: global.logSpeedUpSyncMetadata, emoji: .network, message: "Read correctly: \(serverUrl)", consoleOnly: true)
nkLog(tag: global.logTagSpeedUpSyncMetadata, emoji: .network, message: "Read correctly: \(serverUrl)", consoleOnly: true)
} else {
nkLog(tag: global.logSpeedUpSyncMetadata, emoji: .error, message: "Read failed for \(serverUrl) with error: \(resultsReadFolder.error.errorDescription)")
nkLog(tag: global.logTagSpeedUpSyncMetadata, emoji: .error, message: "Read failed for \(serverUrl) with error: \(resultsReadFolder.error.errorDescription)")
return
}

Expand Down
5 changes: 3 additions & 2 deletions iOSClient/NCGlobal.swift
Original file line number Diff line number Diff line change
Expand Up @@ -390,8 +390,9 @@ final class NCGlobal: Sendable {
let logTagSync = "SYNC"
let logTagServiceProficer = "SERVICE PROVIDER"
let logTagDatabase = "DB"
let logSpeedUpSyncMetadata = "SYNC METADATA"
let logNetworkingTasks = "NETWORKING TASKS"
let logTagSpeedUpSyncMetadata = "SYNC METADATA"
let logTagNetworkingTasks = "NETWORKING TASKS"
let logTagTransferStore = "TRANSFER STORE"

// USER DEFAULTS
//
Expand Down
2 changes: 1 addition & 1 deletion iOSClient/Networking/E2EE/NCNetworkingE2EEUpload.swift
Original file line number Diff line number Diff line change
Expand Up @@ -188,7 +188,7 @@ class NCNetworkingE2EEUpload: NSObject {
metadata.status = NCGlobal.shared.metadataStatusNormal

await self.database.addMetadataAsync(metadata)
await self.database.addLocalFileAsync(metadata: metadata)
await self.database.addLocalFilesAsync(metadatas: [metadata])
utility.createImageFileFrom(metadata: metadata)

await NCNetworking.shared.transferDispatcher.notifyAllDelegates { delegate in
Expand Down
10 changes: 3 additions & 7 deletions iOSClient/Networking/NCBackgroundLocationUploadManager.swift
Original file line number Diff line number Diff line change
@@ -1,10 +1,6 @@
//
// NCBackgroundLocationUploadManager.swift
// Nextcloud
//
// Created by Marino Faggiana on 06/06/25.
// Copyright © 2025 Marino Faggiana. All rights reserved.
//
// SPDX-FileCopyrightText: Nextcloud GmbH
// SPDX-FileCopyrightText: 2025 Marino Faggiana
// SPDX-License-Identifier: GPL-3.0-or-later

import CoreLocation
import NextcloudKit
Expand Down
25 changes: 3 additions & 22 deletions iOSClient/Networking/NCConfigServer.swift
Original file line number Diff line number Diff line change
@@ -1,25 +1,6 @@
//
// NCConfigServer.swift
// Nextcloud
//
// Created by Marino Faggiana on 05/12/22.
// Copyright © 2022 Marino Faggiana. All rights reserved.
//
// Author Marino Faggiana <marino.faggiana@nextcloud.com>
//
// This program is free software: you can redistribute it and/or modify
// it under the terms of the GNU General Public License as published by
// the Free Software Foundation, either version 3 of the License, or
// (at your option) any later version.
//
// This program is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU General Public License for more details.
//
// You should have received a copy of the GNU General Public License
// along with this program. If not, see <http://www.gnu.org/licenses/>.
//
// SPDX-FileCopyrightText: Nextcloud GmbH
// SPDX-FileCopyrightText: 2022 Marino Faggiana
// SPDX-License-Identifier: GPL-3.0-or-later

import Foundation
import UIKit
Expand Down
4 changes: 2 additions & 2 deletions iOSClient/Networking/NCDownloadAction.swift
Original file line number Diff line number Diff line change
Expand Up @@ -160,7 +160,7 @@ class NCDownloadAction: NSObject, UIDocumentInteractionControllerDelegate, NCSel
if let metadata = await NCManageDatabase.shared.getMetadataLivePhotoAsync(metadata: metadata) {
metadatasSynchronizationOffline.append(metadata)
}
await NCManageDatabase.shared.addLocalFileAsync(metadata: metadata, offline: true)
await NCManageDatabase.shared.addLocalFilesAsync(metadatas: [metadata], offline: true)
for metadata in metadatasSynchronizationOffline {
await NCManageDatabase.shared.setMetadataSessionInWaitDownloadAsync(ocId: metadata.ocId,
session: NCNetworking.shared.sessionDownloadBackground,
Expand Down Expand Up @@ -257,7 +257,7 @@ class NCDownloadAction: NSObject, UIDocumentInteractionControllerDelegate, NCSel
etag: download.etag)

if download.nkError == .success {
await NCManageDatabase.shared.addLocalFileAsync(metadata: metadata)
await NCManageDatabase.shared.addLocalFilesAsync(metadatas: [metadata])
if let vc = await NCViewer().getViewerController(metadata: metadata, delegate: viewController) {
viewController.navigationController?.pushViewController(vc, animated: true)
}
Expand Down
Loading