PAL.Loop := True; PAL.WaitForTime(T['08:00:00']); {Wait for 8am} {==================================================} 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; {==================================================} PAL.WaitForTime(T['23:59:59']); {Wait for next day}
PAL.Loop := False; 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']); D.Next; end;