From 42b7590268e5d56a6dda5403a62e1fa734690cc5 Mon Sep 17 00:00:00 2001 From: IanWold Date: Sun, 13 Oct 2024 22:01:52 -0500 Subject: [PATCH] Cast topic name objects to string --- build.csx | 20 +++++++++----------- 1 file changed, 9 insertions(+), 11 deletions(-) diff --git a/build.csx b/build.csx index 157aa84..3ba6c38 100644 --- a/build.csx +++ b/build.csx @@ -155,18 +155,16 @@ new MetalsharpProject() if (post.Metadata.TryGetValue("topics", out var topicsObject) && topicsObject is IEnumerable topicsObjectList) { - foreach (var topicNameElement in topicsObjectList) + foreach (var topicName in topicsObjectList.Cast()) { - 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 ]); + } } } }