Skip to content

Commit

Permalink
NXDRIVE-2912: Display Drive notification for document review --20/06 …
Browse files Browse the repository at this point in the history
…-03 02
  • Loading branch information
gitofanindya committed Jun 20, 2024
1 parent 07cd4c7 commit 0e86cc0
Showing 1 changed file with 14 additions and 14 deletions.
28 changes: 14 additions & 14 deletions nxdrive/gui/api.py
Original file line number Diff line number Diff line change
Expand Up @@ -564,20 +564,20 @@ def get_disk_space_info_to_width(
- Size of space used by other applications converted to percentage of the width.
- Global size of synchronized files converted to percentage of the width.
"""
engine = self._get_engine(uid)

synced = engine.dao.get_global_size() if engine else 0
used, free = disk_space(path)
used_without_sync = used - synced
total = used + free
result = self._balance_percents(
{
"free": free * width / total,
"used_without_sync": used_without_sync * width / total,
"synced": synced * width / total,
}
)
return [result["free"], result["used_without_sync"], result["synced"]]
if engine := self._get_engine(uid):

synced = engine.dao.get_global_size() if engine else 0
used, free = disk_space(path)
used_without_sync = used - synced
total = used + free
result = self._balance_percents(

Check warning on line 573 in nxdrive/gui/api.py

View check run for this annotation

Codecov / codecov/patch

nxdrive/gui/api.py#L569-L573

Added lines #L569 - L573 were not covered by tests
{
"free": free * width / total,
"used_without_sync": used_without_sync * width / total,
"synced": synced * width / total,
}
)
return [result["free"], result["used_without_sync"], result["synced"]]

Check warning on line 580 in nxdrive/gui/api.py

View check run for this annotation

Codecov / codecov/patch

nxdrive/gui/api.py#L580

Added line #L580 was not covered by tests

def _balance_percents(self, result: Dict[str, float], /) -> Dict[str, float]:
"""Return an altered version of the dict in which no value is under a minimum threshold."""
Expand Down

0 comments on commit 0e86cc0

Please sign in to comment.