Remove mimetype check when calculating size

We currently try to skip size formatting for folders. However we
compare with a bogix mimetype so the check is false in every case.
Further folders typically have a size of 512 bytes or 4k. In both
cases we don't really need to skip the size formatting so instead of
fixing the check just skip it and do the size formatting
unconditionally.

Change-Id: I7ef021381bb56acf4b22551cc5d5613470fd6d08
This commit is contained in:
Tobias Henkel 2018-08-02 08:42:24 +02:00
parent 125eeed6fe
commit d6cc971de5
No known key found for this signature in database
GPG Key ID: 03750DEC158E5FA2
1 changed files with 1 additions and 4 deletions

View File

@ -362,10 +362,7 @@ class Indexer():
filename)
output += '<td>%s</td>' % time.asctime(
file_details.last_modified)
if file_details.mimetype == 'folder':
size = str(file_details.size)
else:
size = sizeof_fmt(file_details.size, suffix='')
size = sizeof_fmt(file_details.size, suffix='')
output += '<td style="text-align: right">%s</td>' % size
output += '</tr>\n'