Skip to content

Commit

Permalink
make channel order consistent
Browse files Browse the repository at this point in the history
  • Loading branch information
natekomodo committed Feb 6, 2021
1 parent c0690d8 commit 87f43a8
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions DiscordToMoon/Writers/DiscordImageWriter.cs
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,10 @@ public sealed class DiscordImageWriter : ImageWriter

public DiscordImageWriter(string jsonFolder)
{
_manifest = new JsonLoader(Directory.GetFiles(jsonFolder)).FromDiscord();

_manifest = new JsonLoader(Directory.GetFiles(jsonFolder)).FromDiscord()
.OrderBy(obj => obj.Key)
.ToDictionary(obj => obj.Key, obj => obj.Value);

long characters = _manifest.Values.Select(l => l.Select(s => s.Length).Sum()).Sum() + _manifest.Keys.Select(s => s.Length + 2).Sum();

var pixels = (int)Math.Ceiling((characters / 3f));
Expand Down

0 comments on commit 87f43a8

Please sign in to comment.