Fixed a few minor bugs where library scan would overwrite cleanname of

manually matched track & delete artist would fail.
This commit is contained in:
theguardian
2013-10-09 11:55:29 -07:00
parent 9151a98656
commit 237e429669
2 changed files with 5 additions and 4 deletions

View File

@@ -138,8 +138,7 @@ def libraryScan(dir=None, append=False, ArtistID=None, ArtistName=None, cron=Fal
if not check_exist_song:
myDB.upsert("have", newValueDict, controlValueDict)
new_song_count+=1
#We're going to have to think about metadata changing, and setting Matched = None when/if we do
elif check_exist_song['CleanName'] != CleanName and check_exist_song['Matched'] != "Manual":
elif check_exist_song['ArtistName'] != f_artist or check_exist_song['AlbumTitle'] != f.album or check_exist_song['TrackTitle'] != f.title:
newValueDict['Matched'] = None
myDB.upsert("have", newValueDict, controlValueDict)
new_song_count+=1

View File

@@ -191,7 +191,9 @@ class WebInterface(object):
def deleteArtist(self, ArtistID):
logger.info(u"Deleting all traces of artist: " + ArtistID)
myDB = db.DBConnection()
artistname = myDB.select('SELECT ArtistName from artists where ArtistID=?', [ArtistID]).fetchone()
namecheck = myDB.select('SELECT ArtistName from artists where ArtistID=?', [ArtistID])
for name in namecheck:
artistname=name['ArtistName']
myDB.action('DELETE from artists WHERE ArtistID=?', [ArtistID])
myDB.action('DELETE from albums WHERE ArtistID=?', [ArtistID])
myDB.action('DELETE from tracks WHERE ArtistID=?', [ArtistID])
@@ -451,7 +453,7 @@ class WebInterface(object):
update_count+=1
#This was throwing errors and I don't know why, but it seems to be working fine.
#else:
#logger.info("There was an error modifying Artist %s / Album %s. This should not have happened" % (existing_artist, existing_album))
#logger.info("There was an error modifying Artist %s / Album %s with clean name %s" % (existing_artist, existing_album, existing_clean_string))
logger.info("Manual matching yielded %s new matches for Artist %s / Album %s" % (update_count, new_artist, new_album))
if update_count > 0:
librarysync.update_album_status()