diff --git a/headphones/importer.py b/headphones/importer.py index 4bb3f9a7..815f1390 100644 --- a/headphones/importer.py +++ b/headphones/importer.py @@ -488,6 +488,7 @@ def addArtisttoDB(artistid, extrasonly=False, forcefull=False): if skip_log == 0: logger.info(u"[%s] No new releases, so no changes made to %s" % (artist['artist_name'], rg['title'])) + time.sleep(3) finalize_update(artistid, artist['artist_name'], errors) logger.info(u"Seeing if we need album art for: %s" % artist['artist_name']) @@ -666,6 +667,7 @@ def addReleaseById(rid, rgid=None): #myDB.action('DELETE from have WHERE Location=?', [match['Location']]) myDB.upsert("tracks", newValueDict, controlValueDict) + myDB.upsert("alltracks", newValueDict, controlValueDict) # Reset status if status == 'Loading': diff --git a/headphones/webserve.py b/headphones/webserve.py index db0f52c6..5d197369 100644 --- a/headphones/webserve.py +++ b/headphones/webserve.py @@ -378,6 +378,14 @@ class WebInterface(object): def deleteAlbum(self, AlbumID, ArtistID=None): 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 albums WHERE AlbumID=?', [AlbumID]) myDB.action('DELETE from tracks WHERE AlbumID=?', [AlbumID]) myDB.action('DELETE from allalbums WHERE AlbumID=?', [AlbumID])