Author Topic: script for deleting mp3 duplicates  (Read 211308 times)

Admin

  • Administrator
  • Hero Member
  • *****
  • Posts: 664
    • View Profile
    • https://www.smilarityapp.com
Re: script for deleting mp3 duplicates
« Reply #240 on: May 06, 2020, 21:14:24 »
If you want just forbid marking files with bitrate 320 and above, you can use this automarkin script (you may want change priority too, it's very easy see if):

Code: [Select]
/*
Author: Similarity Team
Version: 1.0
Description:
Simple auto-mark dialog analog
For speedup before launch analyze all files ("Analyze all" context menu)
*/

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

// simple mark by lower bitrate
var dups = results.audio.dups;
for (var idx = 0; idx < dups.length; ++idx) {
let item1 = dups[idx].item1;
let item2 = dups[idx].item2;
        // skip counter-pair (1-2 and 2-1), process pair only once
        if (item1.path > item2.path) continue;
// don't allow mark files with bitrate > 320
mark1 = item1.analysis.bitrate > 320000 ? false : true;
mark2 = item2.analysis.bitrate > 320000 ? false : true;
// first priority
if (item1.analysis.rating > item2.analysis.rating)
{ item2.marked = mark2; continue; }
if (item1.analysis.rating < item2.analysis.rating)
{ item1.marked = mark1; continue; }
// second priority
if (item1.analysis.duration > item2.analysis.duration)
{ item2.marked = mark2; continue; }
if (item1.analysis.duration < item2.analysis.duration)
{ item1.marked = mark1; continue; }
// 3rd priority
if (item1.analysis.maxFreq > item2.analysis.maxFreq)
{ item2.marked = mark2; continue; }
if (item1.analysis.maxFreq < item2.analysis.maxFreq)
{ item1.marked = mark1; continue; }
// 4th priority
if (item1.analysis.clicks > item2.analysis.clicks)
{ item2.marked = mark2; continue; }
if (item1.analysis.clicks < item2.analysis.clicks)
{ item1.marked = mark1; continue; }
// 5th priority
if (item1.analysis.clips > item2.analysis.clips)
{ item2.marked = mark2; continue; }
if (item1.analysis.clips < item2.analysis.clips)
{ item1.marked = mark1; continue; }
}

« Last Edit: May 06, 2020, 21:20:51 by Admin »

hsei

  • Jr. Member
  • **
  • Posts: 70
    • View Profile
Re: script for deleting mp3 duplicates
« Reply #241 on: June 05, 2020, 10:37:42 »
> it seems to always keep the 320kbps mp3 which in theory is great however some of the duplicates that are 192kbps or higher often have 100% rating and sound much better than the 320kbps version which may only have a rating of 79.5?

Data rate alone unfortunately is not always a good quality criterion. Sometimes higher bit rate files (e.g. 320) are just recompressed versions of lower bit rate files (e.g. 128). Their quality of course can't get better, only their size increases.
This may be detected by the rating and audible perception.