salts633 / PhotoFrame

A python/browser based digital photo frame
GNU General Public License v3.0
0 stars 1 forks source link

Manage cache of photo files #10

Closed salts633 closed 4 years ago

salts633 commented 4 years ago

Currently photos from Google Photos are downloaded to disk so they don't need to be retrieved from Google every time they are displayed. This works fine for the testing album (4 photos) but could cause issues with large albums.

The should be a separate time triggered (configurable) task that checks the size of the photo cache and deletes old photos once it goes over a (configurable) limit. This should be protected by a Tornado concurrency lock so that only one task tries to clean up the cache at a time if the time limit is set too low.

salts633 commented 4 years ago

Decided to do this slightly differently, there is now a Cacher class that handles getting/writing the file to disk. I've decided not to worry about concurrency for now as this is only really intended to serve one device at a time so it shouldn't be a problem. see commit e628d15 for Photoframe updates and https://github.com/salts633/DiskCacher for the disk cacher class.