mirror of
https://github.com/meeb/tubesync.git
synced 2025-06-24 14:06:36 +00:00
Report db.sqlite3 size on dashboard
This commit is contained in:
parent
679f77b6b4
commit
3e5711f0f2
@ -85,6 +85,12 @@ class DashboardView(TemplateView):
|
||||
data['config_dir'] = str(settings.CONFIG_BASE_DIR)
|
||||
data['downloads_dir'] = str(settings.DOWNLOAD_ROOT)
|
||||
data['database_connection'] = settings.DATABASE_CONNECTION_STR
|
||||
# Add the database filesize when using db.sqlite3
|
||||
db_name = str(settings.DATABASES["default"]["NAME"])
|
||||
db_path = pathlib.Path(db_name) if '/' == db_name[0] else None
|
||||
if db_path and settings.DATABASE_CONNECTION_STR.startswith('sqlite at '):
|
||||
db_size = db_path.stat().st_size
|
||||
data['database_connection'] += f' ({db_size:,} bytes)'
|
||||
return data
|
||||
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user