Het onderstaande script hoort de laatst requeste tracks in de playlist toe te voegen, maar dat gaat niet helemaal goed.
Hij voegt ze gewoon random toe...
Bron: http://support.spacialaudio.com/wiki/Ho ... in_time%3F
Code: Selecteer alles
{==================================================}
var D : TDataSet;
var C : Integer;
D := Query('SELECT songlist.*, count(*) as cnt '+
'FROM songlist,requestlist '+
'WHERE songlist.ID = requestlist.songID '+
' AND requestlist.code < 700 '+
'GROUP BY songlist.ID '+
'ORDER BY cnt DESC LIMIT 10',[],True);
{Add requests to Queue.
We add to the top of the Queue, effectively reversing the
order of the requests - playing #10 first and #1 last}
C := 0;
D.First;
while not D.EOF do
begin
C := C + 1;
WriteLn('#'+IntToStr(C)+'. '+D['artist']+' - '+D['title']);
Queue.AddFile(D['filename'],ipTop);
D.Next;
end;
{==================================================}