API - workouts refactoring

This commit is contained in:
Sam
2022-02-16 17:46:22 +01:00
parent 0b2e2ed5dd
commit 1b4a477544
20 changed files with 81 additions and 184 deletions

View File

@@ -0,0 +1,16 @@
import os
from fittrackee.files import get_absolute_file_path
def get_upload_dir_size() -> int:
"""
Return upload directory size
"""
upload_path = get_absolute_file_path('')
total_size = 0
for dir_path, _, filenames in os.walk(upload_path):
for f in filenames:
fp = os.path.join(dir_path, f)
total_size += os.path.getsize(fp)
return total_size