files: Updates to not cache thumbnails locally. Also get notified by inotify

This commit is contained in:
Jordan
2021-05-09 13:57:18 -04:00
parent f8ca339de5
commit bd1650fd18
6 changed files with 124 additions and 34 deletions

View File

@@ -100,7 +100,15 @@ class ScreenPanel:
def get_file_image(self, filename, width=1.6, height=1.6):
if not self._files.has_thumbnail(filename):
return None
return self._gtk.PixbufFromFile(self._files.get_thumbnail_location(filename), None, width, height)
loc = self._files.get_thumbnail_location(filename)
if loc == None:
return None
if loc[0] == "file":
return self._gtk.PixbufFromFile(loc[1], None, width, height)
if loc[0] == "http":
return self._gtk.PixbufFromHttp(loc[1], None, width, height)
return None
def home(self, widget):
self._screen._ws.klippy.gcode_script(KlippyGcodes.HOME)