rconradharris / reddit-background

Set your Linux and Mac OS X desktop background to images pulled from Reddit
101 stars 17 forks source link

If file writing fails, just skip the file #19

Closed cjcodes closed 7 years ago

cjcodes commented 7 years ago

[Cloned from #18]

Ran into a problem today downloading a new image because the filename was wayyyyy too long. Here, we just log that an image failed to save and continue along our merry way.

Screenshot of failure: (this was from EarthPorn)

screenshot from 2017-03-17 14-35-06

rconradharris commented 7 years ago

@cjcodes Thanks for reporting this and proposing a fix.

Since we already have code to clip the title for display purposes, I've reused that when generating the filename. https://github.com/rconradharris/reddit-background/commit/35d69991af092a0e2c85328b7070c628996dc027#diff-0cf0313f81034de4f900298ff4d4d22fR534

64 characters should be enough for anybody, right?