Create alltracks when adding album

Potential fix for https://github.com/rembo10/headphones/issues/1586
This commit is contained in:
Ade
2014-08-17 18:14:18 +12:00
parent 06822e2514
commit a7d1f128ad
2 changed files with 10 additions and 0 deletions

View File

@@ -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':

View File

@@ -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])