Skip to content
Snippets Groups Projects
Commit 4baf1a3d authored by Rob Swindell's avatar Rob Swindell :speech_balloon:
Browse files

Use the new file_size_str() usage for prettier sizes-in-bytes

parent 5e6b0ef8
No related branches found
No related tags found
1 merge request!463MRC mods by Codefenix (2024-10-20)
...@@ -110,7 +110,7 @@ for(var i in dir_list) { ...@@ -110,7 +110,7 @@ for(var i in dir_list) {
} }
log("Searching for duplicates in " + total_files + " files (" log("Searching for duplicates in " + total_files + " files ("
+ file_size_str(total_bytes) + " bytes) ..."); + file_size_str(total_bytes, /* unit */1, /* precision */1) + " bytes) ...");
var dupe = { name: [], hash: []}; var dupe = { name: [], hash: []};
var name_bytes = 0; var name_bytes = 0;
var hash_bytes = 0; var hash_bytes = 0;
...@@ -133,7 +133,7 @@ for(var n in hash) { ...@@ -133,7 +133,7 @@ for(var n in hash) {
} }
if(options.names) { if(options.names) {
log(dupe.name.length + " duplicate file names (" + file_size_str(name_bytes) + " bytes)"); log(dupe.name.length + " duplicate file names (" + file_size_str(name_bytes,1 , 1) + " bytes)");
if(options.json) if(options.json)
writeln(JSON.stringify(dupe.name, null, 4)); writeln(JSON.stringify(dupe.name, null, 4));
else else
...@@ -141,7 +141,7 @@ if(options.names) { ...@@ -141,7 +141,7 @@ if(options.names) {
} }
if(hash_type) { if(hash_type) {
log(dupe.hash.length + " duplicate file " + hash_type.toUpperCase() + " sums of at least " log(dupe.hash.length + " duplicate file " + hash_type.toUpperCase() + " sums of at least "
+ min_size + " bytes (" + file_size_str(hash_bytes) + " bytes)"); + min_size + " bytes (" + file_size_str(hash_bytes, 1, 1) + " bytes)");
if(options.json) if(options.json)
writeln(JSON.stringify(dupe.hash, null, 4)); writeln(JSON.stringify(dupe.hash, null, 4));
else else
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment