Skip to content

Commit

Permalink
Cast topic name objects to string
Browse files Browse the repository at this point in the history
  • Loading branch information
IanWold committed Oct 14, 2024
1 parent 94151db commit 42b7590
Showing 1 changed file with 9 additions and 11 deletions.
20 changes: 9 additions & 11 deletions build.csx
Original file line number Diff line number Diff line change
Expand Up @@ -155,18 +155,16 @@ new MetalsharpProject()

if (post.Metadata.TryGetValue("topics", out var topicsObject) && topicsObject is IEnumerable<object> topicsObjectList)
{
foreach (var topicNameElement in topicsObjectList)
foreach (var topicName in topicsObjectList.Cast<string>())
{
Console.WriteLine(topicNameElement.GetType().FullName);
// var topicName = topicNameElement.GetString();
// if (topicPosts.TryGetValue(topicName, out var topicPostsList))
// {
// seriesPosts[topicName] = [ ..topicPostsList, post.Metadata ];
// }
// else
// {
// topicPosts.Add(topicName, [ post.Metadata ]);
// }
if (topicPosts.TryGetValue(topicName, out var topicPostsList))
{
seriesPosts[topicName] = [ ..topicPostsList, post.Metadata ];
}
else
{
topicPosts.Add(topicName, [ post.Metadata ]);
}
}
}
}
Expand Down

0 comments on commit 42b7590

Please sign in to comment.