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,
|
if let urlString = transcription.audioFileURL,
|
||||||
let url = URL(string: urlString),
|
let url = URL(string: urlString),
|
||||||
FileManager.default.fileExists(atPath: url.path) {
|
FileManager.default.fileExists(atPath: url.path) {
|
||||||
try? FileManager.default.removeItem(at: url)
|
do {
|
||||||
transcription.audioFileURL = nil
|
try FileManager.default.removeItem(at: url)
|
||||||
deletedCount += 1
|
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