AlfredoSequeida / venus

Venus aims to be a cross-platform tool to automatically change your desktop wallpaper to something random using images from Unsplash.
MIT License
25 stars 6 forks source link

Add Max Files option #11

Closed coma-toast closed 4 years ago

coma-toast commented 4 years ago

When I first started using this, I set it to 1 minute. That added like 6000 files to the storage directory after a long weekend. I changed it to 15 minutes to reduce that but adding a feature to limit the number of files is a good idea. You can customize how many files to keep in case you like one and want to go back later and save it somewhere permanently.

AlfredoSequeida commented 4 years ago

Great idea! I'll take a look at the code and return with an update.

AlfredoSequeida commented 4 years ago

Ok, so I got an error:

Traceback (most recent call last): File "/usr/bin/venus", line 11, in <module> load_entry_point('venuspy==1.0.2', 'console_scripts', 'venus')() File "/usr/lib/python3.8/site-packages/venus/venus.py", line 86, in main cacheFiles = glob.glob(output_path_config+"/*") TypeError: unsupported operand type(s) for +: 'NoneType' and 'str'

This is happening because output_path_config gets set to None by default on line 71 of venus.py if the user does not choose to have a directory to save the files to, which results in the files being saved in the temporary (tmp) directory later on by the get_wall function.

After you fix that we should be good, at a quick glance everything else looks great!

coma-toast commented 4 years ago

Added an and to the if statement so it only runs if the output_path_config is set.

AlfredoSequeida commented 4 years ago

Awesome! Looks good! I'll go ahead and mearge the change. Thank you for your work!