Hallo miteinander
Kurze Rückfrage - und ich weiss, der Thread ist recht alt, aber dennoch:
Ich habe das Script von Torben mit Überarbeitung von 711andi zum Import der Gain-Tags in die bestehende Datenbank genutzt.
Das Script hat “nur” 86 Elemente von ca. 9’000 in der Datenbank verarbeitet, dauerte aber recht lange.
Hat jemand eine Idee, woran dies liegen könnte?
EDIT:
mAirList-Version
3.1.7, Build 958
Genutztes Script:
var stmt: IZPreparedStatement; rs: IZResultSet; ts: TStringList; i: integer; pi1, pi2: IFilePlaylistItem;begin
ts := TStringList.Create;
try// Fetch all File item IDs - we need to lock the database in order to // protect the connection Database(0).BeginRead; try stmt := ImAirListDB(Database(0)).GetConnection.PrepareStatement( 'SELECT idx FROM items WHERE xmltype=''File''' ); rs := stmt.ExecuteQueryPrepared; while rs.Next do ts.Add(rs.GetString(1)); finally Database(0).EndRead; end; SystemLog('Found ' + IntToStr(ts.Count) + ' files.'); for i := 0 to ts.Count - 1 do begin // load first item from database pi1 := IFilePlaylistItem(Database(0).CreatePlaylistItem(ts[i])); SystemLog(pi1.GetFilename); try // create second item directly from the file, read tags //pi2 := IFilePlaylistItem(Factory.CreatePlaylistItemFromFile(pi1.GetFilename, [fitTags])); pi2 := IFilePlaylistItem(Factory.CreatePlaylistItemFromFile(pi1.GetFilename, [fitNativeTags])); // Is the amplification different from the one stored in the database? if IAmplifyable(pi1).GetAmplification <> IAmplifyable(pi2).GetAmplification then begin SystemLog('Amplification has changed'); // Copy amplification over to the database item IAmplifyable(pi1).SetAmplification(IAmplifyable(pi2).GetAmplification); // write changes back to the database Database(0).SavePlaylistItem(pi1); end; except SystemLog('Error'); end; end;
finally
ts.Free;
end;end.