From 939cc3235b7bc518c32affc834050fb3e663ea07 Mon Sep 17 00:00:00 2001 From: echel0n Date: Mon, 7 Apr 2014 11:09:42 -0700 Subject: [PATCH] Fixed it so autoProcessMovie returns success if clientAgent is not a torrent client when download_id is empty --- nzbToCouchPotato.py | 1 + nzbtomedia/autoProcess/autoProcessMovie.py | 6 +++++- 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/nzbToCouchPotato.py b/nzbToCouchPotato.py index b2990953..63b680d0 100755 --- a/nzbToCouchPotato.py +++ b/nzbToCouchPotato.py @@ -198,6 +198,7 @@ if os.environ.has_key('NZBOP_SCRIPTDIR') and not os.environ['NZBOP_VERSION'][0:5 # All checks done, now launching the script. download_id = "" + if os.environ.has_key('NZBPR_COUCHPOTATO'): download_id = os.environ['NZBPR_COUCHPOTATO'] Logger.info("MAIN: Script triggered from NZBGet, starting autoProcessMovie...") result = autoProcessMovie().process(os.environ['NZBPP_DIRECTORY'], os.environ['NZBPP_NZBFILENAME'], clientAgent="nzbget", inputCategory=os.environ['NZBPP_CATEGORY']) diff --git a/nzbtomedia/autoProcess/autoProcessMovie.py b/nzbtomedia/autoProcess/autoProcessMovie.py index 3f99ee5a..db48f1de 100644 --- a/nzbtomedia/autoProcess/autoProcessMovie.py +++ b/nzbtomedia/autoProcess/autoProcessMovie.py @@ -214,6 +214,7 @@ class autoProcessMovie: protocol = "https://" else: protocol = "http://" + # don't delay when we are calling this script manually. if clientAgent == "manual": delay = 0 @@ -304,7 +305,10 @@ class autoProcessMovie: if clientAgent == "manual": return 0 # success if not download_id: - return 1 # just to be sure TorrentToMedia doesn't start deleting files as we havent verified changed status. + if clientAgent in ['utorrent', 'transmission', 'deluge'] : + return 1 # just to be sure TorrentToMedia doesn't start deleting files as we havent verified changed status. + else: + return 0 # we will now check to see if CPS has finished renaming before returning to TorrentToMedia and unpausing. socket.setdefaulttimeout(int(config.NZBTOMEDIA_TIMEOUT)) #initialize socket timeout.