Füge Überprüfung hinzu, um Tracks mit mehr als einem bestehenden Memory Cue zu überspringen und aktualisiere die Ausgabe mit übersprungenen Tracks.
This commit is contained in:
12
main.py
12
main.py
@@ -34,6 +34,7 @@ def copy_hot_cues_to_memory_cues(xml_file_path, output_file_path=None, backup=Tr
|
||||
tracks_processed = 0
|
||||
total_hot_cues_copied = 0
|
||||
total_hot_cues_skipped = 0
|
||||
tracks_skipped = 0
|
||||
|
||||
# Alle TRACK Elemente finden
|
||||
for track in root.findall(".//TRACK"):
|
||||
@@ -54,6 +55,14 @@ def copy_hot_cues_to_memory_cues(xml_file_path, output_file_path=None, backup=Tr
|
||||
|
||||
# Hot Cues als Memory Cues kopieren
|
||||
if hot_cues_in_track:
|
||||
# Prüfen, ob bereits mehr als 1 Memory Cue existiert
|
||||
if len(memory_cues_in_track) > 1:
|
||||
track_artist = track.get("Artist", "Unbekannt")
|
||||
track_title = track.get("Name", "Unbekannt")
|
||||
print(f"Track '{track_artist} - {track_title}' übersprungen - bereits {len(memory_cues_in_track)} Memory Cues vorhanden")
|
||||
tracks_skipped += 1
|
||||
continue
|
||||
|
||||
tracks_processed += 1
|
||||
|
||||
# Set mit bestehenden Memory Cue Positionen erstellen (für schnelle Suche)
|
||||
@@ -114,8 +123,11 @@ def copy_hot_cues_to_memory_cues(xml_file_path, output_file_path=None, backup=Tr
|
||||
tree.write(output_path, encoding="utf-8", xml_declaration=True)
|
||||
print(f"\nErgebnis gespeichert in: {output_path}")
|
||||
print(f"Verarbeitete Tracks: {tracks_processed}")
|
||||
print(f"Übersprungene Tracks: {tracks_skipped}")
|
||||
print(f"Kopierte Hot Cues: {total_hot_cues_copied}")
|
||||
print(f"Übersprungene Hot Cues: {total_hot_cues_skipped}")
|
||||
if tracks_skipped > 0:
|
||||
print("(Übersprungene Tracks: bereits mehr als 1 Memory Cue vorhanden)")
|
||||
if total_hot_cues_skipped > 0:
|
||||
print("(Übersprungene Hot Cues: Memory Cue an gleicher Position bereits vorhanden)")
|
||||
except Exception as e:
|
||||
|
Reference in New Issue
Block a user