fixed stats and user handler

This commit is contained in:
Zurdi
2024-07-04 23:11:07 +02:00
parent bc99663fe6
commit 46ce99b2e6
4 changed files with 17 additions and 8 deletions

View File

@@ -34,4 +34,6 @@ class DBStatsHandler(DBBaseHandler):
@begin_session
def get_total_filesize(self, session: Session = None) -> int:
"""Get the total filesize of all roms in the database, in bytes."""
return session.scalar(select(func.sum(Rom.file_size_bytes)).select_from(Rom))
return (
session.scalar(select(func.sum(Rom.file_size_bytes)).select_from(Rom)) or 0
)