mirror of
https://github.com/rembo10/headphones.git
synced 2026-05-21 11:05:32 +01:00
Remove from have when deleting Album
This commit is contained in:
@@ -379,12 +379,10 @@ class WebInterface(object):
|
||||
logger.info(u"Deleting all traces of album: " + AlbumID)
|
||||
myDB = db.DBConnection()
|
||||
|
||||
namecheck = myDB.select('SELECT ArtistName, AlbumTitle from albums where AlbumID=?', [AlbumID])
|
||||
for name in namecheck:
|
||||
artist = name['ArtistName']
|
||||
album = name['AlbumTitle']
|
||||
|
||||
myDB.action('UPDATE have SET Matched=NULL WHERE ArtistName=? AND AlbumTitle=?', (artist, album))
|
||||
myDB.action('DELETE from have WHERE Matched=?', [AlbumID])
|
||||
album = myDB.action('SELECT ArtistName, AlbumTitle from albums where AlbumID=?', [AlbumID]).fetchone()
|
||||
if album:
|
||||
myDB.action('DELETE from have WHERE ArtistName=? AND AlbumTitle=?', [album['ArtistName'], album['AlbumTitle']])
|
||||
|
||||
myDB.action('DELETE from albums WHERE AlbumID=?', [AlbumID])
|
||||
myDB.action('DELETE from tracks WHERE AlbumID=?', [AlbumID])
|
||||
|
||||
Reference in New Issue
Block a user