diff --git a/ivatar/views.py b/ivatar/views.py index 997a824..45f6bf9 100644 --- a/ivatar/views.py +++ b/ivatar/views.py @@ -698,6 +698,8 @@ class StatsView(TemplateView, JsonResponse): if result and result[0] > 0: photo_count, avg_size_bytes = result + # Convert to float in case SQLite returns string + avg_size_bytes = float(avg_size_bytes) if avg_size_bytes else 0 avg_size_kb = round(avg_size_bytes / 1024, 2) if avg_size_bytes else 0 avg_size_mb = ( round(avg_size_bytes / (1024 * 1024), 2) if avg_size_bytes else 0