Note that this Wiki is a work in progress, items may not be updated or may disappear entirely as the pages are updated.
UPDATED: Cleaning up your song database (removing invalid songs)
From SpacialAudio
Just copy and paste for your database cleaning needs.
NOTE: This is deprecated and can easily be done using the "Tools>Maintenance>Verify tracks" tool built into SAM.
{
PAL Script to remove songs from database that no longer exists
or that has been moved to a new location.
}
var D : TDataSet;
var cnt : Integer = 0;
D := Query('SELECT ID,filename FROM songlist', [], True);
PAL.LockExecution;
D.First;
while not D.EOF do
begin
if not FileExists(D['filename']) then
begin
cnt := cnt + 1;
WriteLn('Removing ' + D['filename']);
ExecSQL('DELETE FROM songlist WHERE ID = :ID',[D['ID']]);
ExecSQL('DELETE FROM categorylist WHERE songID = :ID',[D['ID']]);
// If you use Toby's ClockWheel script you'll also need the next line
// ExecSQL('DELETE FROM historylist WHERE songID = :ID',[D['ID']]);
end;
D.Next;
end;
WriteLn(IntToStr(cnt)+' songs were removed');
PAL.UnlockExecution;
