mirror of
https://github.com/Dvorinka/swingmusic-extended.git
synced 2026-06-03 20:13:02 +00:00
check if track exists in db before sending file
This commit is contained in:
@@ -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)
|
||||
|
||||
Reference in New Issue
Block a user