Closed dolohow closed 8 years ago
User can still specify to run the program every hour and this wouldn't allow then the wallpaper to be changed, however, there is some tweaking that needs to be done.
So maybe we could store the information in ~/.cache when we fetched last time along with pictures?
Maybe store the URLs of the last fetched images (e.g. 3 URLs should be enough)
And where you want to put that file? I could use a shelve module for that.
Instead of saving picture as subreddit name + date, we could add hour into date so it doesn't override existing one, if 'hourly' option is used.
Could it happen that for example at 1am and 2am the wallpaper could be the same?
@dolohow , yeah, wallpaper on the subreddit could be the same. Then another option is to save reddit post ID in filename and if it is same, just don't download it
I would go with that option and let's forget about the date, we already have ctime, let's say wallpaper-ID.jpg. What do you guys think?
subreddit-ID.jpg would do the Trick
@dolohow @remggo Good suggestion. We should go with this one.
I will try to prepare appropriate PR for that.
@ssimunic Please review this new approach.
Thanks
@dolohow Good job!
As this program fetches wallpapers daily, there is no reason to do that when the program is invoked twice the same day.
By verifying whether the wallpaper file already exists we can conclude that the program was already run during that day.