From 082a6b2b8313b1a2deb2cf99572c1aac881e892a Mon Sep 17 00:00:00 2001 From: cranci1 <100066266+cranci1@users.noreply.github.com> Date: Tue, 17 Jun 2025 16:22:33 +0200 Subject: [PATCH] fixed downlaods --- Sora/SoraApp.swift | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/Sora/SoraApp.swift b/Sora/SoraApp.swift index 5b33256..95e8cd4 100644 --- a/Sora/SoraApp.swift +++ b/Sora/SoraApp.swift @@ -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") }