LiquidFun / aoc_tiles

Fancy Advent of Code README tiles showing the completion status of the challenges per day
Apache License 2.0
26 stars 3 forks source link

Bug Fix -- count-as-solved-when option='either' #5

Closed karl-sparks closed 10 months ago

karl-sparks commented 10 months ago

Hi, thanks for aoc-tiles, I love it!

I've found some bugs with the count-as-solved-when options so thought it would be useful to submit fixes via pull requests.

I'm new to git-hub pull requests so appreciate any feedback on the best way to go about this.

Bug description: 'either' option of count-as-solved-when errors in the situation when there is a file for a day but the day hasn't been completed yet on the leaderboard. It fails because it tries format the time but it was provided as None.

Fix: When rendering the tile, check that the time/score from the leaderboard has been supplied. If its None, default to the checkmark method.

aoc-tiles now works for me using the tests for the 2022 year (which I've only completed days 1-5 but there are files for all 25 days in the test folder)

LiquidFun commented 10 months ago

Happy new year!

Thanks for the pull request! Since you asked for feedback: I think it's great how you did it.