HydrogenAudio

Hosted Forums => foobar2000 => General - (fb2k) => Topic started by: Dexter_prog on 2013-01-08 03:25:51

Title: Automatically filter duplicates from playlists
Post by: Dexter_prog on 2013-01-08 03:25:51
Is there any way for a playlist to automatically perform the "edit > remove duplicates" function? I created a separate playlist from my autoplaylist and if a I add a new album by band that was already on the new playlist, if I add the whole discography, I get duplicates (naturally). Can them be somehow whipped  automatically?
Title: Automatically filter duplicates from playlists
Post by: marc2003 on 2013-01-09 10:14:59
add a WSH panel mod (http://www.hydrogenaudio.org/forums/index.php?showtopic=70363) panel to your layout and put this code in...

Code: [Select]
function on_playlist_items_added() {
    fb.RunMainMenuCommand("Edit/Remove duplicates");
}
Title: Automatically filter duplicates from playlists
Post by: marc2003 on 2013-01-10 09:48:50
i just realised the above only worked when dragging files onto the playlist. this should work properly...

Code: [Select]
function on_playlist_items_added() {
    plman.SetActivePlaylistContext();
    fb.RunMainMenuCommand("Edit/Remove duplicates");
}

//this code draws the background the same colour as the foobar splitter so you can resize the panel to hide it better.

var ww = 0;
var wh = 0;

function on_size() {
    ww = window.Width;
    wh = window.Height;
}

function on_paint(gr) {
    gr.FillSolidRect(0, 0, ww, wh, utils.GetSysColor(15));
}