Private GIT

Skip to content
Snippets Groups Projects
Commit 30bfe47e authored by miigotu's avatar miigotu
Browse files

Fix displayShow showing -1.00 B for shows with missing dir, now shows 0.00 B

parent 03e3f477
No related branches found
No related tags found
No related merge requests found
......@@ -162,19 +162,12 @@ def pretty_file_size(size):
:param size: The size to convert
:return: The converted size
"""
if isinstance(size, (str, unicode)) and size.isdigit():
size = float(size)
elif not isinstance(size, (int, long, float)):
return ''
size = float(max(try_int(size), 0))
remaining_size = size
for unit in ['B', 'KB', 'MB', 'GB', 'TB', 'PB']:
if remaining_size < 1024.:
return '%3.2f %s' % (remaining_size, unit)
remaining_size /= 1024.
remaining_size //= 1024.
return size
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment