mirror of
https://github.com/cranci1/Sora.git
synced 2026-01-11 20:10:24 +00:00
fixed downlaods
This commit is contained in:
parent
be325f84b2
commit
082a6b2b83
1 changed files with 11 additions and 0 deletions
|
|
@ -116,6 +116,17 @@ struct SoraApp: App {
|
|||
for url in tmpContents {
|
||||
try fileManager.removeItem(at: url)
|
||||
}
|
||||
|
||||
let parentURL = tmpURL.deletingLastPathComponent()
|
||||
let parentContents = try fileManager.contentsOfDirectory(at: parentURL, includingPropertiesForKeys: [.isDirectoryKey])
|
||||
for url in parentContents {
|
||||
if url.lastPathComponent.hasPrefix("com.apple.UserManagedAssets") {
|
||||
var isDir: ObjCBool = false
|
||||
if fileManager.fileExists(atPath: url.path, isDirectory: &isDir), isDir.boolValue {
|
||||
try fileManager.removeItem(at: url)
|
||||
}
|
||||
}
|
||||
}
|
||||
} catch {
|
||||
Logger.shared.log("Failed to clear tmp folder: \(error.localizedDescription)", type: "Error")
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in a new issue