Fix potential orphaned audio files in automatic cleanup

This commit is contained in:
Beingpax 2026-01-12 09:12:58 +05:45
parent d1fe77f2aa
commit b280ede0bb

View File

@ -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
}
}
}