check if track exists in db before sending file

This commit is contained in:
mungai-njoroge
2023-06-19 21:49:13 +03:00
parent a201303bd9
commit cc6552cb94
17 changed files with 96 additions and 31 deletions
+6 -1
View File
@@ -17,13 +17,17 @@ class SQLiteAlbumMethods:
"""
cur.execute(sql, (albumhash, colors))
return cur.lastrowid
lastrowid = cur.lastrowid
cur.close()
return lastrowid
@classmethod
def get_all_albums(cls):
with SQLiteManager() as cur:
cur.execute("SELECT * FROM albums")
albums = cur.fetchall()
cur.close()
if albums is not None:
return albums
@@ -35,6 +39,7 @@ class SQLiteAlbumMethods:
with SQLiteManager() as cur:
cur.execute("SELECT * FROM albums WHERE albumartist=?", (albumartist,))
albums = cur.fetchall()
cur.close()
if albums is not None:
return tuples_to_albums(albums)