From 54c85c79518264346c14569ad5b5f4e914e46f9b Mon Sep 17 00:00:00 2001 From: rembo10 Date: Mon, 28 Apr 2014 15:55:42 -0700 Subject: [PATCH] Added some logging to see why postprocessor is not automatically running --- headphones/__init__.py | 1 + headphones/postprocessor.py | 13 +++++++++---- 2 files changed, 10 insertions(+), 4 deletions(-) diff --git a/headphones/__init__.py b/headphones/__init__.py index b354291b..3e6e643c 100644 --- a/headphones/__init__.py +++ b/headphones/__init__.py @@ -1109,6 +1109,7 @@ def start(): SCHED.add_interval_job(versioncheck.checkGithub, minutes=CHECK_GITHUB_INTERVAL) if DOWNLOAD_SCAN_INTERVAL > 0: + logger.info("download_scan_interval is non-zero - FORTESTING") SCHED.add_interval_job(postprocessor.checkFolder, minutes=DOWNLOAD_SCAN_INTERVAL) SCHED.start() diff --git a/headphones/postprocessor.py b/headphones/postprocessor.py index d1ccbee4..e07a983f 100644 --- a/headphones/postprocessor.py +++ b/headphones/postprocessor.py @@ -32,15 +32,17 @@ postprocessor_lock = threading.Lock() def checkFolder(): + logger.info("Checking download folder - FORTESTING") with postprocessor_lock: myDB = db.DBConnection() snatched = myDB.select('SELECT * from snatched WHERE Status="Snatched"') - + logger.info("Checking snatched albums - FORTESTING") for album in snatched: + logger.info("Got an album to check for - FORTESTING") if album['FolderName']: - + logger.info("Album has a foldername: %s - FORTESTING" % album['FolderName']) if album['Kind'] == 'nzb': # We're now checking sab config options after sending to determine renaming - but we'll keep the # iterations in just in case we can't read the config for some reason @@ -56,7 +58,7 @@ def checkFolder(): nzb_album_path = os.path.join(headphones.DOWNLOAD_DIR, nzb_folder_name).encode(headphones.SYS_ENCODING, 'replace') if os.path.exists(nzb_album_path): - logger.debug('Found %s in NZB download folder. Verifying....' % album['FolderName']) + logger.info('Found %s in NZB download folder. Verifying....' % album['FolderName']) verify(album['AlbumID'], nzb_album_path, 'nzb') if album['Kind'] == 'torrent': @@ -64,9 +66,12 @@ def checkFolder(): torrent_album_path = os.path.join(headphones.DOWNLOAD_TORRENT_DIR, album['FolderName']).encode(headphones.SYS_ENCODING,'replace') if os.path.exists(torrent_album_path): - logger.debug('Found %s in torrent download folder. Verifying....' % album['FolderName']) + logger.info('Found %s in torrent download folder. Verifying....' % album['FolderName']) verify(album['AlbumID'], torrent_album_path, 'torrent') + else: + logger.info("No folder name found for " + album['Title']) + def verify(albumid, albumpath, Kind=None, forced=False): myDB = db.DBConnection()