From 307a564ad56f92460a90d88ad582f264447f5196 Mon Sep 17 00:00:00 2001 From: rembo10 Date: Wed, 19 Dec 2012 10:53:57 -0500 Subject: [PATCH] Some bug fixes for preserving torrent files after post processing --- headphones/postprocessor.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/headphones/postprocessor.py b/headphones/postprocessor.py index 719628d2..853ed3fa 100644 --- a/headphones/postprocessor.py +++ b/headphones/postprocessor.py @@ -319,7 +319,7 @@ def doPostProcessing(albumid, albumpath, release, tracks, downloaded_track_list, logger.info('Starting post-processing for: %s - %s' % (release['ArtistName'], release['AlbumTitle'])) # Check to see if we're preserving the torrent dir - if headphones.KEEP_TORRENT_FILES and Kind="torrent": + if headphones.KEEP_TORRENT_FILES and Kind=="torrent": new_folder = os.path.join(os.path.dirname(albumpath), ('temp' + release['AlbumTitle'][:5]).encode(headphones.SYS_ENCODING, 'replace')) try: shutil.copytree(albumpath, new_folder) @@ -842,7 +842,7 @@ def forcePostProcess(): snatched = myDB.action('SELECT AlbumID, Title, Kind from snatched WHERE FolderName LIKE ?', [folder_basename]).fetchone() if snatched: logger.info('Found a match in the database: %s. Verifying to make sure it is the correct album' % snatched['Title']) - verify(snatched['AlbumID'], folder, kind) + verify(snatched['AlbumID'], folder, Snatched['Kind']) continue # Try to parse the folder name into a valid format