File tree Expand file tree Collapse file tree 1 file changed +6
-2
lines changed Expand file tree Collapse file tree 1 file changed +6
-2
lines changed Original file line number Diff line number Diff line change @@ -50,8 +50,10 @@ private static void Write(string content, string filePath)
50
50
51
51
private static async Task < string > GetSourceDataAsync ( )
52
52
{
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
53
55
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" ) ;
55
57
}
56
58
57
59
private static IEnumerable < Icon > GetIcons ( string sourceData )
@@ -62,7 +64,9 @@ private static IEnumerable<Icon> GetIcons(string sourceData)
62
64
jObject [ "icons" ] ? . Select ( t => new Icon (
63
65
t [ "name" ] ? . ToString ( ) . Underscore ( ) . Pascalize ( ) ?? throw new Exception ( "Failed to find name" ) ,
64
66
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 ( )
66
70
?? throw new Exception ( "Failed to find aliases" ) ) ) ?? throw new Exception ( "failed to find icons" )
67
71
) ;
68
72
You can’t perform that action at this time.
0 commit comments