From e07fafda6ee133556712e43b3f8a01048495cf94 Mon Sep 17 00:00:00 2001 From: Ade Date: Sat, 27 Sep 2014 09:40:31 +1200 Subject: [PATCH] Don't auto search for manually added VA albums --- headphones/importer.py | 13 ++++++++++--- headphones/webserve.py | 4 +++- 2 files changed, 13 insertions(+), 4 deletions(-) diff --git a/headphones/importer.py b/headphones/importer.py index 79d52c1d..01576f8d 100644 --- a/headphones/importer.py +++ b/headphones/importer.py @@ -664,14 +664,21 @@ def addReleaseById(rid, rgid=None): myDB.upsert("tracks", newValueDict, controlValueDict) # Reset status + wanted = True if status == 'Loading': controlValueDict = {"AlbumID": rgid} - newValueDict = {"Status": "Wanted"} + if artistid not in blacklisted_special_artists: + newValueDict = {"Status": "Wanted"} + else: + newValueDict = {"Status": "Skipped"} + wanted = False myDB.upsert("albums", newValueDict, controlValueDict) # Start a search for the album - import searcher - searcher.searchforalbum(rgid, False) + if wanted: + import searcher + searcher.searchforalbum(rgid, False) + elif not rg_exists and not release_dict: logger.error("ReleaseGroup does not exist in the database and did not get a valid response from MB. Skipping release.") if status == 'Loading': diff --git a/headphones/webserve.py b/headphones/webserve.py index 6d7012aa..275b3e4e 100644 --- a/headphones/webserve.py +++ b/headphones/webserve.py @@ -221,6 +221,7 @@ class WebInterface(object): rgids = myDB.select('SELECT DISTINCT ReleaseGroupID FROM albums JOIN releases ON AlbumID = ReleaseGroupID WHERE ArtistID=?', [ArtistID]) for rgid in rgids: myDB.action('DELETE from releases WHERE ReleaseGroupID=?', [rgid['ReleaseGroupID']]) + myDB.action('DELETE from have WHERE Matched=?', [rgid['ReleaseGroupID']]) myDB.action('DELETE from albums WHERE ArtistID=?', [ArtistID]) myDB.action('DELETE from tracks WHERE ArtistID=?', [ArtistID]) @@ -228,10 +229,11 @@ class WebInterface(object): rgids = myDB.select('SELECT DISTINCT ReleaseGroupID FROM allalbums JOIN releases ON AlbumID = ReleaseGroupID WHERE ArtistID=?', [ArtistID]) for rgid in rgids: myDB.action('DELETE from releases WHERE ReleaseGroupID=?', [rgid['ReleaseGroupID']]) + myDB.action('DELETE from have WHERE Matched=?', [rgid['ReleaseGroupID']]) myDB.action('DELETE from allalbums WHERE ArtistID=?', [ArtistID]) myDB.action('DELETE from alltracks WHERE ArtistID=?', [ArtistID]) - myDB.action('UPDATE have SET Matched=NULL WHERE ArtistName=?', [artistname]) + myDB.action('DELETE from have WHERE ArtistName=?', [artistname]) myDB.action('INSERT OR REPLACE into blacklist VALUES (?)', [ArtistID]) raise cherrypy.HTTPRedirect("home") deleteArtist.exposed = True