This commit is contained in:
Clinton Hall 2013-02-27 18:36:05 -08:00
commit c690af3515

View file

@ -23,11 +23,16 @@
import sys import sys
import logging
import autoProcessTV import autoProcessTV
from nzbToMediaEnv import * from nzbToMediaEnv import *
from nzbToMediaUtil import *
print "nzbToSickBeard %s" % VERSION nzbtomedia_configure_logging(os.path.dirname(sys.argv[0]))
Logger = logging.getLogger(__name__)
Logger.info("nzbToSickBeard %s", VERSION)
# SABnzbd # SABnzbd
if len(sys.argv) == 8: if len(sys.argv) == 8:
@ -39,7 +44,7 @@ if len(sys.argv) == 8:
# 5 User-defined category # 5 User-defined category
# 6 Group that the NZB was posted in e.g. alt.binaries.x # 6 Group that the NZB was posted in e.g. alt.binaries.x
# 7 Status of post processing. 0 = OK, 1=failed verification, 2=failed unpack, 3=1+2 # 7 Status of post processing. 0 = OK, 1=failed verification, 2=failed unpack, 3=1+2
print "Script triggered from SABnzbd, starting autoProcessTV..." Logger.info("Script triggered from SABnzbd, starting autoProcessTV...")
autoProcessTV.processEpisode(sys.argv[1], sys.argv[2], sys.argv[7]) autoProcessTV.processEpisode(sys.argv[1], sys.argv[2], sys.argv[7])
# NZBGet # NZBGet
@ -48,11 +53,10 @@ elif len(sys.argv) == 4:
# 1 The final directory of the job (full path) # 1 The final directory of the job (full path)
# 2 The original name of the NZB file # 2 The original name of the NZB file
# 3 The status of the download: 0 == successful # 3 The status of the download: 0 == successful
print "Script triggered from NZBGet, starting autoProcessTV..." Logger.info("Script triggered from NZBGet, starting autoProcessTV...")
autoProcessTV.processEpisode(sys.argv[1], sys.argv[2], sys.argv[3]) autoProcessTV.processEpisode(sys.argv[1], sys.argv[2], sys.argv[3])
else: else:
print "Invalid number of arguments received from client." Logger.debug("Invalid number of arguments received from client.")
print "Running autoProcessTV as a manual run..." Logger.info("Running autoProcessTV as a manual run...")
autoProcessTV.processEpisode('Manual Run', 'Manual Run', 0) autoProcessTV.processEpisode('Manual Run', 'Manual Run', 0)