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

Scan and remove all invalid songs...

From SpacialAudio

Jump to: navigation, search

The following PAL script will scan your complete song database and remove all songs that no longer exists. Be warned that for 5000+ music libraries this can take a while - so I would not recommend running this on a live station...


var D : TDataSet;
D := QUERY('SELECT * FROM songlist',[],True);
PAL.LockExecution;
D.First;
while not D.EOF do
begin
if not FileExists(D['filename']) then
 begin
   WriteLn('Removing '+D['filename']);
   ExecSQL('DELETE FROM songlist WHERE ID = :ID',[D['ID']]);
   ExecSQL('DELETE FROM categorylist WHERE songID = :ID',[D['ID']]);
 end;
D.Next;
end;
PAL.UnLockExecution;

Please note that this script is no longer needed in the newest versions of SAM.

Personal tools