From 50919cddb81ffb05627634e7abac61b1faf29372 Mon Sep 17 00:00:00 2001 From: billypom on debian Date: Sat, 7 Sep 2024 12:50:44 -0400 Subject: [PATCH] notes --- components/MusicTable.py | 3 +++ utils/add_files_to_library.py | 2 -- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/components/MusicTable.py b/components/MusicTable.py index 3d3e0a0..3b58342 100644 --- a/components/MusicTable.py +++ b/components/MusicTable.py @@ -162,12 +162,15 @@ class MusicTable(QTableView): pass selected_filepaths = self.get_selected_songs_filepaths() selected_indices = self.get_selected_rows() + # FIXME: this should be batch delete with a worker thread + # probably pass selected_filepaths to a worker thread for file in selected_filepaths: with DBA.DBAccess() as db: song_id = db.query( "SELECT id FROM song WHERE filepath = ?", (file,) )[0][0] delete_song_id_from_database(song_id) + # This part cannot be thread...i think? bcus its Q stuff happening for index in selected_indices: try: self.model.removeRow(index) diff --git a/utils/add_files_to_library.py b/utils/add_files_to_library.py index 5302ff8..1e1b0df 100644 --- a/utils/add_files_to_library.py +++ b/utils/add_files_to_library.py @@ -68,7 +68,6 @@ def add_files_to_library(files, progress_callback=None): bitrate, ) ) - logging.info("insert data appended") # Check if batch size is reached if len(insert_data) >= 1000: logging.info(f"inserting a LOT of songs: {len(insert_data)}") @@ -79,7 +78,6 @@ def add_files_to_library(files, progress_callback=None): ) insert_data = [] # Reset the insert_data list else: - logging.info("continuing...") # continue adding files if we havent reached big length continue # Insert any remaining data