filename sorting

This forum is for questions / discussions regarding development of addons / tweaks for MediaMonkey.

Moderator: Gurus

filename sorting

Postby aabra1 » Tue Aug 16, 2011 4:29 pm

is there a way to sort SDB.AllVisibleSongList by file name and /or file path?

I need to have all the tracks listed in filename order ascending before I process the list.
I have to order them now by clicking on Filename header and then running the script I wrote.
Would be nice to automate filename sorting too.

thanks
Last edited by Lowlander on Tue Aug 16, 2011 4:36 pm, edited 1 time in total.
Reason: Moved to correct sub-forum
aabra1
 
Posts: 4
Joined: Tue Aug 16, 2011 4:11 pm

Postby Eyal » Thu Aug 18, 2011 1:51 am

I gess you could assign SDB.AllVisibleSongList to a temp object and use a SQL command to sort it.

See code samples here: http://www.mediamonkey.com/wiki/index.php/Sample_Read_and_Write_Method(s)

:~)
Skins for MediaMonkey: Cafe, Carbon, Helium, Spotify, Zekton. [ Wiki Zone ].
Eyal
 
Posts: 3099
Joined: Sun Jun 26, 2005 9:27 am
Location: Québec

Re: filename sorting

Postby aabra1 » Tue Oct 20, 2015 12:53 pm

I figures it out and sorted by file path:

Set list = SDB.AllVisibleSongList
' sort the list
Set objSortedList = CreateObject( "System.Collections.Sortedlist" )
For i=0 To list.count-1
Set itm = list.Item(i)
'MsgBox TypeName(itm) 'SDBSongData
objSortedList.add itm.Path, itm
Next

' Process all selected tracks
For i=0 To objSortedList.count-1
Set itm = objSortedList.GetByIndex(i)
number = number + 1
Next
aabra1
 
Posts: 4
Joined: Tue Aug 16, 2011 4:11 pm


Return to MediaMonkey 4 Addons developer forum

Who is online

Users browsing this forum: No registered users and 3 guests