Fixed bug where "Delete empty artists would delete artists where we have tracks but the latest album is not set because the artist was added directly for a single album

This commit is contained in:
Patrick Speiser
2012-10-04 01:08:03 +02:00
parent f6c6d22993
commit 4b836ee2c4

View File

@@ -194,7 +194,7 @@ class WebInterface(object):
def deleteEmptyArtists(self):
logger.info(u"Deleting all empty artists")
myDB = db.DBConnection()
emptyArtistIDs = [row['ArtistID'] for row in myDB.select("SELECT ArtistID FROM artists WHERE HaveTracks == 0 OR LatestAlbum IS NULL")]
emptyArtistIDs = [row['ArtistID'] for row in myDB.select("SELECT ArtistID FROM artists WHERE HaveTracks == 0")]
for ArtistID in emptyArtistIDs:
logger.info(u"Deleting all traces of artist: " + ArtistID)
myDB.action('DELETE from artists WHERE ArtistID=?', [ArtistID])