Public Access
Make meeting lifecycle stateful
This commit is contained in:
@@ -36,10 +36,10 @@ public static class MeetingArtifactFrontmatterRenderer
|
||||
AppendScalar(builder, "title", frontmatter.Title);
|
||||
AppendDateTime(builder, "start_time", frontmatter.StartTime);
|
||||
AppendDateTime(builder, "end_time", frontmatter.EndTime);
|
||||
AppendQuoted(builder, "meeting", frontmatter.Meeting);
|
||||
AppendQuoted(builder, "transcript", frontmatter.Transcript);
|
||||
AppendQuoted(builder, "assistant_context", frontmatter.AssistantContext);
|
||||
AppendQuoted(builder, "summary", frontmatter.Summary);
|
||||
AppendQuotedIfNotEmpty(builder, "meeting", frontmatter.Meeting);
|
||||
AppendQuotedIfNotEmpty(builder, "transcript", frontmatter.Transcript);
|
||||
AppendQuotedIfNotEmpty(builder, "assistant_context", frontmatter.AssistantContext);
|
||||
AppendQuotedIfNotEmpty(builder, "summary", frontmatter.Summary);
|
||||
if (!string.IsNullOrWhiteSpace(frontmatter.State))
|
||||
{
|
||||
AppendScalar(builder, "state", frontmatter.State);
|
||||
@@ -73,16 +73,33 @@ public static class MeetingArtifactFrontmatterRenderer
|
||||
string title,
|
||||
string sourceNotePath,
|
||||
string? state = null)
|
||||
{
|
||||
return Create(
|
||||
artifacts,
|
||||
title,
|
||||
meetingNote.Frontmatter.StartTime,
|
||||
meetingNote.Frontmatter.EndTime,
|
||||
sourceNotePath,
|
||||
state);
|
||||
}
|
||||
|
||||
public static MeetingArtifactFrontmatter Create(
|
||||
MeetingSessionArtifacts artifacts,
|
||||
string title,
|
||||
DateTimeOffset? startTime,
|
||||
DateTimeOffset? endTime,
|
||||
string sourceNotePath,
|
||||
string? state = null)
|
||||
{
|
||||
return new MeetingArtifactFrontmatter
|
||||
{
|
||||
Title = title,
|
||||
StartTime = meetingNote.Frontmatter.StartTime,
|
||||
EndTime = meetingNote.Frontmatter.EndTime,
|
||||
Meeting = ObsidianLink.ToWikiLink(artifacts.MeetingNotePath, sourceNotePath, "Meeting Note"),
|
||||
Transcript = ObsidianLink.ToWikiLink(artifacts.TranscriptPath, sourceNotePath, "Transcript"),
|
||||
AssistantContext = ObsidianLink.ToWikiLink(artifacts.AssistantContextPath, sourceNotePath, "Assistant Context"),
|
||||
Summary = ObsidianLink.ToWikiLink(artifacts.SummaryPath, sourceNotePath, "Summary"),
|
||||
StartTime = startTime,
|
||||
EndTime = endTime,
|
||||
Meeting = LinkUnlessSelf(artifacts.MeetingNotePath, sourceNotePath, "Meeting Note"),
|
||||
Transcript = LinkUnlessSelf(artifacts.TranscriptPath, sourceNotePath, "Transcript"),
|
||||
AssistantContext = LinkUnlessSelf(artifacts.AssistantContextPath, sourceNotePath, "Assistant Context"),
|
||||
Summary = LinkUnlessSelf(artifacts.SummaryPath, sourceNotePath, "Summary"),
|
||||
State = state
|
||||
};
|
||||
}
|
||||
@@ -108,6 +125,16 @@ public static class MeetingArtifactFrontmatterRenderer
|
||||
builder.AppendLine(EscapeQuoted(value));
|
||||
}
|
||||
|
||||
private static void AppendQuotedIfNotEmpty(StringBuilder builder, string key, string? value)
|
||||
{
|
||||
if (string.IsNullOrWhiteSpace(value))
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
AppendQuoted(builder, key, value);
|
||||
}
|
||||
|
||||
private static void AppendDateTime(StringBuilder builder, string key, DateTimeOffset? value)
|
||||
{
|
||||
builder.Append(key);
|
||||
@@ -145,4 +172,19 @@ public static class MeetingArtifactFrontmatterRenderer
|
||||
: value;
|
||||
}
|
||||
|
||||
private static string LinkUnlessSelf(string targetPath, string sourceNotePath, string label)
|
||||
{
|
||||
return IsSamePath(targetPath, sourceNotePath)
|
||||
? ""
|
||||
: ObsidianLink.ToWikiLink(targetPath, sourceNotePath, label);
|
||||
}
|
||||
|
||||
private static bool IsSamePath(string first, string second)
|
||||
{
|
||||
return string.Equals(
|
||||
Path.GetFullPath(first),
|
||||
Path.GetFullPath(second),
|
||||
StringComparison.OrdinalIgnoreCase);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user