From a4fe0efd9a47a55325c8004871c4488ff27467bb Mon Sep 17 00:00:00 2001 From: sbuser Date: Fri, 5 Aug 2011 17:39:50 -0500 Subject: [PATCH 1/3] Fix to make sure we don't re-add releases manually. Was comparing to releaseid. Now properly comparing to releasegroupid --- headphones/importer.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/headphones/importer.py b/headphones/importer.py index 0a5171c0..c3c6720d 100644 --- a/headphones/importer.py +++ b/headphones/importer.py @@ -272,7 +272,7 @@ def addReleaseById(rid): #we don't want to make more calls to MB here unless we have to, could be happening quite a lot #TODO: why do I have to str() this here? I don't get it. - rg_exists = myDB.select("SELECT * from albums WHERE AlbumID=?", [rid]) + rg_exists = myDB.select("SELECT * from albums WHERE AlbumID=?", [rgid]) #make sure the artist exists since I don't know what happens later if it doesn't artist_exists = myDB.select("SELECT * from artists WHERE ArtistID=?", [release_dict['artist_id']]) From b7813de8562e518b3d66bb90ce8895a2a544c219 Mon Sep 17 00:00:00 2001 From: sbuser Date: Fri, 5 Aug 2011 17:51:56 -0500 Subject: [PATCH 2/3] Fix post-processing of external folders adding blank artists (wrong controlValue) --- headphones/postprocessor.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/headphones/postprocessor.py b/headphones/postprocessor.py index 72c22f9d..cb0a8087 100644 --- a/headphones/postprocessor.py +++ b/headphones/postprocessor.py @@ -101,7 +101,7 @@ def verify(albumid, albumpath): myDB.upsert("tracks", newValueDict, controlValueDict) - controlValueDict = {"ArtistID": albumid} + controlValueDict = {"ArtistID": release_dict['artist_id']} newValueDict = {"Status": "Paused"} myDB.upsert("artists", newValueDict, controlValueDict) From c047b90ea3e4269c5c614935bf008370414ede87 Mon Sep 17 00:00:00 2001 From: sbuser Date: Fri, 5 Aug 2011 18:01:50 -0500 Subject: [PATCH 3/3] Make sure we aren't renaming unprocessed folders every time they are re-post-processed. --- headphones/postprocessor.py | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/headphones/postprocessor.py b/headphones/postprocessor.py index cb0a8087..e97d46b1 100644 --- a/headphones/postprocessor.py +++ b/headphones/postprocessor.py @@ -164,7 +164,11 @@ def verify(albumid, albumpath): logger.warn('Could not identify album: %s. It may not be the intended album.' % albumpath) myDB.action('UPDATE snatched SET status = "Unprocessed" WHERE AlbumID=?', [albumid]) - renameUnprocessedFolder(albumpath) + processed = re.search(r' \(Unprocessed\)(?:\[\d+\])?', albumpath) + if not processed: + renameUnprocessedFolder(albumpath) + else: + logger.info("Already marked as unprocessed: " + albumpath) def doPostProcessing(albumid, albumpath, release, tracks, downloaded_track_list):