Posted by: cedricpah
« on: November 26, 2017, 10:42:07 »Hi,
More simple this script will prepare delete and mklink command for marked files. But there will be dups so with excel you need to clean the list. That's why I log precise, because I will sort result for each "to deleted" file by precise desc. After, just keep the upper value (for E4 cell just use this formula =SI(NB.SI(C$1:C3;C4)=0;C4;"") (sorry formula in french excel relase). And with this script it can keep the filename with extension of hard linked file.
More simple this script will prepare delete and mklink command for marked files. But there will be dups so with excel you need to clean the list. That's why I log precise, because I will sort result for each "to deleted" file by precise desc. After, just keep the upper value (for E4 cell just use this formula =SI(NB.SI(C$1:C3;C4)=0;C4;"") (sorry formula in french excel relase). And with this script it can keep the filename with extension of hard linked file.
Code: [Select]
/*
Author: Cedric
Description: prepare mklink for marked files
*/
var dups = results.audio.dups;
for (var idx = 0; idx < dups.length; ++idx) {
if (!(dups[idx].item1.marked == true && dups[idx].item2.marked == false)) continue;
try {
var scores = audio.calculate(dups[idx].item1, dups[idx].item2, 'precise');
log(scores['precise'] + ';delete "'+ dups[idx].item1 + '";mklink /h "' + dups[idx].item1.toString().replace(/\..+$/, '') + dups[idx].item2.toString().split('.').pop() + '" "' + dups[idx].item2+ '"' );
}
catch (e) {
log('Exception ' + e);
}
}