Fix potential orphaned audio files in automatic cleanup
This commit is contained in:
parent
d1fe77f2aa
commit
b280ede0bb
@ -121,9 +121,13 @@ class AudioCleanupManager {
|
||||
if let urlString = transcription.audioFileURL,
|
||||
let url = URL(string: urlString),
|
||||
FileManager.default.fileExists(atPath: url.path) {
|
||||
try? FileManager.default.removeItem(at: url)
|
||||
transcription.audioFileURL = nil
|
||||
deletedCount += 1
|
||||
do {
|
||||
try FileManager.default.removeItem(at: url)
|
||||
transcription.audioFileURL = nil
|
||||
deletedCount += 1
|
||||
} catch {
|
||||
// Skip this file - don't update audioFileURL if deletion failed
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user