Account for files that are in bytes

This commit is contained in:
Miguel Jacq 2018-02-14 17:20:00 +11:00
parent 7a8e828cd5
commit 5172294dfa
No known key found for this signature in database
GPG Key ID: EEA4341C6D97A0B6

View File

@ -139,7 +139,7 @@
<script>
// Function to convert human-readable sizes back to bytes, for sorting
function unhumanize(text) {
var powers = {'k': 1, 'm': 2, 'g': 3, 't': 4};
var powers = {'b': 0, 'k': 1, 'm': 2, 'g': 3, 't': 4};
var regex = /(\d+(?:\.\d+)?)\s?(B|K|M|G|T)?/i;
var res = regex.exec(text);
if(res[2] === undefined) {