diff --git a/NucleicRemote/NucleicRemote/Models/SessionCache.swift b/NucleicRemote/NucleicRemote/Models/SessionCache.swift index 118d543..fa8b0f2 100644 --- a/NucleicRemote/NucleicRemote/Models/SessionCache.swift +++ b/NucleicRemote/NucleicRemote/Models/SessionCache.swift @@ -70,7 +70,7 @@ enum SessionCache { let kept = Array(summaries.sorted { $0.updatedAt > $1.updatedAt }.prefix(sessionLimit)) if let data = try? JSONEncoder().encode(kept) { try? data.write(to: url, options: .atomic) } // Drop transcript files for sessions that fell out of the recent set. - let keep = Set(kept.map(transcriptFileName)) + let keep = Set(kept.map { transcriptFileName($0.sessionID) }) if let files = try? FileManager.default.contentsOfDirectory( at: dir, includingPropertiesForKeys: nil) { for file in files where !keep.contains(file.lastPathComponent) {