salomonsky commited on
Commit
754753e
1 Parent(s): 5a1d2cc

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +5 -3
app.py CHANGED
@@ -106,9 +106,11 @@ def save_image(image, seed):
106
  return None
107
 
108
  def get_storage():
109
- files = [{"name": str(file.resolve()), "size": file.stat().st_size} for file in DATA_PATH.glob("*.jpg") if file.is_file()]
110
- usage = sum([f['size'] for f in files])
111
- return [f["name"] for f in files], f"Uso total: {usage/(1024.0 ** 3):.3f}GB"
 
 
112
 
113
  def get_prompts():
114
  prompt_files = [file for file in DATA_PATH.glob("*.txt") if file.is_file()]
 
106
  return None
107
 
108
  def get_storage():
109
+ files = [file for file in DATA_PATH.glob("*.jpg") if file.is_file()]
110
+ files.sort(key=lambda x: x.stat().st_mtime, reverse=True)
111
+ usage = sum([file.stat().st_size for file in files])
112
+ return [str(file.resolve()) for file in files], f"Uso total: {usage/(1024.0 ** 3):.3f}GB"
113
+
114
 
115
  def get_prompts():
116
  prompt_files = [file for file in DATA_PATH.glob("*.txt") if file.is_file()]