mirror of
https://github.com/rowboatlabs/rowboat.git
synced 2026-07-21 21:31:12 +02:00
fix(x): don't overwrite same-titled meeting notes within a day
Note filenames derive from the meeting title, so every ad-hoc detected meeting (titled "Meeting") — and any recurring calendar event repeating its summary — resolved to the same file and each recording clobbered the previous one's notes. Suffix with the start timestamp when the path already exists.
This commit is contained in:
parent
95f232cca9
commit
3419cf8ef0
1 changed files with 10 additions and 1 deletions
|
|
@ -493,7 +493,16 @@ export function useMeetingTranscription(onAutoStop?: () => void) {
|
|||
const filename = calendarEvent?.summary
|
||||
? calendarEvent.summary.replace(/[\\/*?:"<>|]/g, '').replace(/\s+/g, '_').substring(0, 100).trim()
|
||||
: `meeting-${timestamp}`;
|
||||
const notePath = `knowledge/Meetings/rowboat/${dateFolder}/${filename}.md`;
|
||||
let notePath = `knowledge/Meetings/rowboat/${dateFolder}/${filename}.md`;
|
||||
// Title-derived names collide within a day — every ad-hoc detection is
|
||||
// titled "Meeting", and recurring calendar events repeat their summary.
|
||||
// Never overwrite an earlier meeting's note: suffix with the timestamp.
|
||||
if (calendarEvent?.summary) {
|
||||
try {
|
||||
const { exists } = await window.ipc.invoke('workspace:exists', { path: notePath });
|
||||
if (exists) notePath = `knowledge/Meetings/rowboat/${dateFolder}/${filename}-${timestamp}.md`;
|
||||
} catch { /* fall through with the unsuffixed path */ }
|
||||
}
|
||||
notePathRef.current = notePath;
|
||||
calendarEventRef.current = calendarEvent;
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue