From 4e3c577202be65734edec4b3b5a017847d17c782 Mon Sep 17 00:00:00 2001 From: Roland Date: Sun, 26 Mar 2023 13:07:31 -0600 Subject: [PATCH] Using all files in file_group.files as the total count, rather than all the file_groups. --- wrolpi/files/lib.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/wrolpi/files/lib.py b/wrolpi/files/lib.py index 70e2c65a..b8c4d99d 100644 --- a/wrolpi/files/lib.py +++ b/wrolpi/files/lib.py @@ -688,7 +688,8 @@ def get_file_statistics(): with get_db_curs() as curs: curs.execute(''' SELECT - COUNT(id) AS "total_count", + -- All items in file_group.files are real individual files. + SUM(json_array_length(files)) AS "total_count", COUNT(id) FILTER (WHERE file_group.mimetype = 'application/pdf') AS "pdf_count", COUNT(id) FILTER (WHERE file_group.mimetype = 'application/zip') AS "zip_count", COUNT(id) FILTER (WHERE file_group.mimetype LIKE 'video/%') AS "video_count",