Skip to content

Commit

Permalink
Get topic list type
Browse files Browse the repository at this point in the history
  • Loading branch information
IanWold committed Oct 14, 2024
1 parent ddabc39 commit 94151db
Showing 1 changed file with 12 additions and 15 deletions.
27 changes: 12 additions & 15 deletions build.csx
Original file line number Diff line number Diff line change
Expand Up @@ -153,23 +153,20 @@ new MetalsharpProject()
}
}

if (post.Metadata.TryGetValue("topics", out var topicsObject))
if (post.Metadata.TryGetValue("topics", out var topicsObject) && topicsObject is IEnumerable<object> topicsObjectList)
{
Console.WriteLine(topicsObject.GetType().FullName);
if (topicsObject is JsonElement topicNamesElement)
foreach (var topicNameElement in topicsObjectList)
{
foreach (var topicNameElement in topicNamesElement.EnumerateArray())
{
var topicName = topicNameElement.GetString();
if (topicPosts.TryGetValue(topicName, out var topicPostsList))
{
seriesPosts[topicName] = [ ..topicPostsList, post.Metadata ];
}
else
{
topicPosts.Add(topicName, [ post.Metadata ]);
}
}
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 ]);
// }
}
}
}
Expand Down

0 comments on commit 94151db

Please sign in to comment.