Skip to content

Commit 8e4b49e

Browse files
jnavarromcmacera
authored andcommitted
IOS-8721: Add logs when getting children and when load photos and videos
1 parent d57f380 commit 8e4b49e

File tree

3 files changed

+10
-3
lines changed

3 files changed

+10
-3
lines changed

iMEGA/Cloud drive/CloudDriveViewController.m

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -401,7 +401,9 @@ - (void)prepareNodesAndNavigationBarForDisplayMode:(DisplayMode)displayMode {
401401
self.parentNode = [MEGASdk.shared rootNode];
402402
}
403403
[self updateNavigationBarTitle];
404+
MEGALogDebug(@"[Search] children for parent %@", [MEGASdk base64HandleForHandle:self.parentNode.handle]);
404405
self.nodes = [MEGASdk.shared childrenForParent:self.parentNode order:[Helper sortTypeFor:self.parentNode]];
406+
MEGALogDebug(@"[Search] children loaded %ld", (long)self.nodes.size);
405407
self.hasMediaFiles = [self.viewModel hasMediaFilesWithNodes:self.nodes];
406408
[self updateSearchAppearanceFor:self.viewModePreference_ObjC];
407409
break;

iMEGA/Cloud drive/MediaDiscovery/MediaDiscoveryViewModel.swift

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -97,13 +97,15 @@ final class MediaDiscoveryViewModel: NSObject, ViewModelType, NodesUpdateProtoco
9797
private func loadNodes() {
9898
loadingTask = Task { @MainActor in
9999
do {
100+
MEGALogDebug("[Search] load photos and videos in parent: \(parentNode.base64Handle), recursive: true, exclude sensitive: false")
100101
nodes = try await mediaDiscoveryUseCase.nodes(
101102
forParent: parentNode,
102103
recursive: true,
103104
excludeSensitive: false)
105+
MEGALogDebug("[Search] nodes loaded \(nodes.count)")
104106
invokeCommand?(.loadMedia(nodes: nodes))
105107
} catch {
106-
MEGALogError("Error loading nodes: \(error.localizedDescription)")
108+
MEGALogError("[Search] Error loading nodes: \(error.localizedDescription)")
107109
}
108110
}
109111
}

iMEGA/Cloud drive/MediaDiscovery/SwiftUI/MediaDiscoveryContentViewModel.swift

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -95,16 +95,19 @@ final class MediaDiscoveryContentViewModel: ObservableObject {
9595
do {
9696
viewState = .normal
9797
try Task.checkCancellation()
98+
let shouldExcludeSensitiveItems = await shouldExcludeSensitiveItems()
99+
MEGALogDebug("[Search] load photos and videos in parent: \(parentNode.base64Handle), recursive: \(shouldIncludeSubfolderMedia), exclude sensitive \(shouldExcludeSensitiveItems)")
98100
let nodes = try await mediaDiscoveryUseCase.nodes(
99101
forParent: parentNode,
100102
recursive: shouldIncludeSubfolderMedia,
101-
excludeSensitive: await shouldExcludeSensitiveItems())
103+
excludeSensitive: shouldExcludeSensitiveItems)
102104
try Task.checkCancellation()
105+
MEGALogDebug("[Search] nodes loaded \(nodes.count)")
103106
photoLibraryContentViewModel.library = await sortIntoPhotoLibrary(nodes: nodes, sortOrder: sortOrder)
104107
try Task.checkCancellation()
105108
viewState = nodes.isEmpty ? .empty : .normal
106109
} catch {
107-
MEGALogError("Error loading nodes: \(error.localizedDescription)")
110+
MEGALogError("[Search] Error loading nodes: \(error.localizedDescription)")
108111
}
109112
}
110113

0 commit comments

Comments
 (0)