Note that this Wiki is a work in progress, items may not be updated or may disappear entirely as the pages are updated.

How to play Top10 requests at a certain time?

From SpacialAudio

Jump to: navigation, search

PAL script to play top10 requests at a specified time

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}
Personal tools