Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix repository compression size #1751

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion src/vorta/assets/UI/repotab.ui
Original file line number Diff line number Diff line change
Expand Up @@ -421,7 +421,7 @@
</widget>
</item>
<item row="4" column="0">
<widget class="QLabel" name="label_12">
<widget class="QLabel" name="sizeCompressedLabel">
<property name="text">
<string>Compressed Size:</string>
</property>
Expand Down
6 changes: 5 additions & 1 deletion src/vorta/borg/create.py
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,11 @@ 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']

# Compressed Repository size only supported in borg v1.
if not borg_compat.check('V2'):
repo.unique_csize = stats['unique_csize']

repo.unique_size = stats['unique_size']
repo.total_unique_chunks = stats['total_unique_chunks']
repo.save()
Expand Down
5 changes: 5 additions & 0 deletions src/vorta/borg/info_archive.py
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,11 @@ def process_result(self, result):
stats = result['data']['cache']['stats']
repo = RepoModel.get(id=result['params']['repo_id'])
repo.total_size = stats['total_size']

# Compressed Repository size only supported in borg v1.
if not borg_compat.check('V2'):
repo.unique_csize = stats['unique_csize']

repo.unique_size = stats['unique_size']
repo.total_unique_chunks = stats['total_unique_chunks']
repo.save()
5 changes: 5 additions & 0 deletions src/vorta/borg/info_repo.py
Original file line number Diff line number Diff line change
Expand Up @@ -61,6 +61,11 @@ def process_result(self, result):
if 'cache' in result['data']:
stats = result['data']['cache']['stats']
new_repo.total_size = stats['total_size']

# Compressed Repository size only supported in borg v1.
if not borg_compat.check('V2'):
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
5 changes: 5 additions & 0 deletions src/vorta/views/repo_tab.py
Original file line number Diff line number Diff line change
Expand Up @@ -69,6 +69,11 @@ def __init__(self, parent=None):

self.populate_from_profile() # needs init of ssh and compression items

# Compressed Repository size only supported in borg v1.
if borg_compat.check('V2'):
self.sizeCompressed.hide()
self.sizeCompressedLabel.hide()

def set_icons(self):
self.bAddSSHKey.setIcon(get_colored_icon("plus"))
self.bAddRepo.setIcon(get_colored_icon("plus"))
Expand Down