Closed subdan closed 4 years ago
Thanks for investigating this @subdan , unfortunately we've known about this issue for a while but just haven't had time to investigate a really good direction on a fix.
One potential short-term solution is to limit the recursion on the file discovery to a set depth. This would likely fix the issue for 95% of use cases as directories with massive numbers of files are usually nested quite deep.
This would be as simple as:
var files = [String]()
for case let path as String in enumerator {
// Limit recursion to 2 levels
if enumerator.level > 2 {
enumerator.skipDescendants()
}
files.append(path)
}
A more robust solution would be to only look for files that might actually exist. Since the download filename/path for all possible videos is theoretically known, we could build that list (in the background), then check the existence of expected files.
DownloadManager.updateDownloadedFlagsByEnumeratingFilesAtPath
freezes the app because I changed Downloads folder to ~/Documents where I store all my files (50 Gb).