Author: MarquisEXB

Link: http://forums.winamp.com/showthread.php?postid=1868990#post1868990

'~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
' Re-written to affect ALL songs in playlist. 02/19/06
'
' This will reorder it, taking any songs
' by duplicate artists & move them to the end.
'
'~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
 
Set Dict1 = CreateObject("Scripting.dictionary") 
Dict1.CompareMode = BinaryCompare 
 
' the following for/next
' takes the dbindex (ml location) into
' Dict1 -- an array by artist name
for each track in playlist
Dict1(ucase(track.artist))=Dict1(ucase(track.artist)) & vbcrlf & track.DbIndex
next
 
playlist.clear
 
set ml = medialibrary ' this is so we can enqueue it later.
 
i=0 ' i represents the number of times to go through the array
 
do 
	EndLoop=TRUE
	i=i+1
 
	for each Songs in Dict1.Items 
 
	if ubound(split(songs,vbcrlf)) >= (i)  then 
		EndLoop=FALSE
		ml(split(songs,vbcrlf)(i)).enqueue
	end if
 
	next	'for each Songs in Dict1.Items 
 
' set sep = LoadItem("X:~~ " & i  & " ~~~~~~~~~~~~~~")
' sep.insert(playlist.count)
 
loop until EndLoop or i > 100000 ' failsafe
 
quit
 
examples/playlist/move_duplicate_artists_to_end_of_playlist.txt · Last modified: 2006/11/06 15:44
 
Recent changes RSS feed Creative Commons License Powered by PHP Valid XHTML 1.0 Valid CSS Driven by DokuWiki
Music Plugins