handle watching ~/ dir

+ fix bug that caused duplicate album colors in db
This commit is contained in:
geoffrey45
2023-01-23 17:10:05 +03:00
parent d676459b9a
commit 22fa3eef40
7 changed files with 121 additions and 31 deletions
+5 -11
View File
@@ -130,15 +130,9 @@ class SQLiteTrackMethods:
cur.execute("DELETE FROM tracks WHERE filepath=?", (filepath,))
@staticmethod
def track_exists(filepath: str):
"""
Checks if a track exists in the database using its filepath.
"""
def remove_tracks_by_folders(folders: list[str]):
sql = "DELETE FROM tracks WHERE folder = ?"
with SQLiteManager() as cur:
cur.execute("SELECT * FROM tracks WHERE filepath=?", (filepath,))
row = cur.fetchone()
if row is not None:
return True
return False
for folder in folders:
cur.execute(sql, (folder,))