Skip to content

Commit

Permalink
Remove compression field. Don't store timezone in db.
Browse files Browse the repository at this point in the history
* 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.
  • Loading branch information
m3nu committed Jan 21, 2023
1 parent 2b2d61b commit f9d1260
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 4 deletions.
5 changes: 3 additions & 2 deletions src/vorta/borg/create.py
Original file line number Diff line number Diff line change
Expand Up @@ -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'],
Expand All @@ -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()
Expand Down
1 change: 0 additions & 1 deletion src/vorta/borg/info_repo.py
Original file line number Diff line number Diff line change
Expand Up @@ -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']:
Expand Down
2 changes: 1 addition & 1 deletion src/vorta/borg/list_repo.py
Original file line number Diff line number Diff line change
Expand Up @@ -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()

0 comments on commit f9d1260

Please sign in to comment.