Skip to content

Commit 9d97b02

Browse files
authored
Fixing icon update (#3062)
1 parent fcc92c5 commit 9d97b02

File tree

1 file changed

+6
-2
lines changed

1 file changed

+6
-2
lines changed

mdresgen/IconThing.cs

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -50,8 +50,10 @@ private static void Write(string content, string filePath)
5050

5151
private static async Task<string> GetSourceDataAsync()
5252
{
53+
//Might want to consider leveraging one of the other json sources.
54+
//https://github.com/Pictogrammers/pictogrammers.com/blob/18993aab2e9f0f647aa5b54faf995ae1718bc505/docs/contribute/api.mdx
5355
return await Client.GetStringAsync(
54-
"https://materialdesignicons.com/api/package/38EF63D0-4744-11E4-B3CF-842B2B6CFE1B");
56+
"https://dev.materialdesignicons.com/api/package/38EF63D0-4744-11E4-B3CF-842B2B6CFE1B");
5557
}
5658

5759
private static IEnumerable<Icon> GetIcons(string sourceData)
@@ -62,7 +64,9 @@ private static IEnumerable<Icon> GetIcons(string sourceData)
6264
jObject["icons"]?.Select(t => new Icon(
6365
t["name"]?.ToString().Underscore().Pascalize() ?? throw new Exception("Failed to find name"),
6466
t["data"]?.ToString() ?? throw new Exception("Failed to find data"),
65-
t["aliases"]?.ToObject<IEnumerable<string>>()?.Select(x => x.Underscore().Pascalize()).ToList()
67+
t["aliases"]?.ToObject<IEnumerable<JObject>>()?
68+
.Select(x => x["name"]?.ToString().Underscore().Pascalize())
69+
.OfType<string>().ToList()
6670
?? throw new Exception("Failed to find aliases"))) ?? throw new Exception("failed to find icons")
6771
);
6872

0 commit comments

Comments
 (0)