Post reply

Warning: this topic has not been posted in for at least 120 days.
Unless you're sure you want to reply, please consider starting a new topic.

Note: this post will not display until it's been approved by a moderator.

Name:
Email:
Subject:
Message icon:

Verification:
This site name www.[site].com?:

shortcuts: hit alt+s to submit/post or alt+p to preview


Topic Summary

Posted by: Admin
« on: September 11, 2019, 19:48:42 »

Sorry for the delay, I think you want this:

Code: [Select]
// unmark all files
results.audio.unmark();

// simple mark by lower bitrate
var dups = results.audio.dups;
for (var idx = 0; idx < dups.length; ++idx) {
    // skip counter-pair (1-2 and 2-1), process pair only once
    if (dups[idx].item1.path > dups[idx].item2.path) continue;
    // check for our special tag restrictions
    //if (!checkRestrictions(dups[idx].item1, dups[idx].item2)) continue;
    // ok now we select by our priority
    if (dups[idx].item1.analysis.rating > dups[idx].item2.analysis.rating && dups[idx].item1.audio.bitrate > dups[idx].item2.audio.bitrate)
dups[idx].item2.marked = true;
}
Posted by: mkling
« on: July 16, 2019, 17:05:13 »

I'm getting this error   26:Uncaught SyntaxError: Unexpected Identifier

I'm trying to make a script that marks files in audio results. I want to mark a file in each pair  only if the bitrate is lower and the rating is lower.

/*
Author: Similarity Team and edited by user
Version: 1.0
Description:
Mark files after scan only if tags restrictions satisfied. Priority by rating (you can simply change it).
*/


{
// unmark all files
results.audio.unmark();



// simple mark by lower bitrate
var dups = results.audio.dups;
var dups1 = results.anaysis.dups;
for (var idx = 0; idx < dups.length; ++idx) {
    // skip counter-pair (1-2 and 2-1), process pair only once
    if (dups[idx].item1.path > dups[idx].item2.path) continue;
    // check for our special tag restrictions
    if (!checkRestrictions(dups[idx].item1, dups[idx].item2)) continue;
    // ok now we select by our priority
    if (dups[idx].item1.analysis.rating > dups[idx].item2.analysis.rating) and (dups1[idx].item1.audio.bitrate > dups1[idx].item2.audio.bitrate) dups[idx].item2.marked = true;

}
}