1
0
Fork 0
mirror of https://github.com/borgbase/vorta synced 2025-01-02 21:25:48 +00:00

Remove compression field. Don't store timezone in db.

* src/vorta/borg/create.py (BorgCreateJob.process_result): Remove timezone from snapshot time.
	Don't save compressed size.

* src/vorta/borg/info_repo.py (BorgInfoRepoJob.process_result): Remove compressed size.

* src/vorta/borg/list_repo.py (BorgListRepoJob.process_result): Remove timezone from archive time.
This commit is contained in:
Manu 2023-01-20 23:12:36 +01:00 committed by real-yfprojects
parent 0e1cc19051
commit d3350779c7
No known key found for this signature in database
GPG key ID: 00F630DFDEE25747
3 changed files with 4 additions and 4 deletions

View file

@ -15,7 +15,8 @@ def process_result(self, result):
snapshot_id=result['data']['archive']['id'],
defaults={
'name': result['data']['archive']['name'],
'time': dt.fromisoformat(result['data']['archive']['start']),
# SQLite can't save timezone, so we remove it here. TODO: Keep as UTC?
'time': dt.fromisoformat(result['data']['archive']['start']).replace(tzinfo=None),
'repo': result['params']['repo_id'],
'duration': result['data']['archive']['duration'],
'size': result['data']['archive']['stats']['deduplicated_size'],
@ -26,7 +27,7 @@ def process_result(self, result):
stats = result['data']['cache']['stats']
repo = RepoModel.get(id=result['params']['repo_id'])
repo.total_size = stats['total_size']
repo.unique_csize = stats['unique_csize']
# repo.unique_csize = stats['unique_csize']
repo.unique_size = stats['unique_size']
repo.total_unique_chunks = stats['total_unique_chunks']
repo.save()

View file

@ -57,7 +57,6 @@ def process_result(self, result):
if 'cache' in result['data']:
stats = result['data']['cache']['stats']
new_repo.total_size = stats['total_size']
new_repo.unique_csize = stats['unique_csize']
new_repo.unique_size = stats['unique_size']
new_repo.total_unique_chunks = stats['total_unique_chunks']
if 'encryption' in result['data']:

View file

@ -52,7 +52,7 @@ def process_result(self, result):
repo=repo.id,
defaults={
'name': archive['name'],
'time': dt.fromisoformat(archive['time']),
'time': dt.fromisoformat(archive['time']).replace(tzinfo=None),
},
)
new_archive.save()