We are in the process of migrating the Spacial Wiki content to our new Help Center at spacial.com.
Please visit the Help Center for latest Tips and Tricks, Documentation and Troubleshooting.
spacial.com/help-center

Scan and remove all invalid songs...

From SpacialAudio

Revision as of 23:34, 9 June 2007 by James (Talk | contribs)
(diff) ←Older revision | Current revision (diff) | Newer revision→ (diff)
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