dconnolly / chromecast-backgrounds

Archive of all Chromecast background images.
MIT License
617 stars 161 forks source link

Fixed resizing when downloading from backgrounds.json #4

Closed mattburns closed 10 years ago

mattburns commented 10 years ago

When using the option --load to load the urls form a json file, the regex didn't match the size part of the urls in backgrounds.json (eg, this part /s2560/).

Also, UpdateDimensions was called before they were fetched from the file and so weren't updated.

dconnolly commented 10 years ago

Looks like the updated regex matches the simple /s2560/ size encoding but doesn't match the more complicated ones like /s1280-w1280-c-h720-k-no/, and in some cases did a replace like /s720/s1280-w1280-c-h720-k-no/.

dconnolly commented 10 years ago

I updated the regex and associated logic to fix the /s2560/ matching issue, and moved resizing to after the set merge of old and new backgrounds. Thanks for the PR. :+1: