From 85f79fddf2106257221ab31ceda06437f663d510 Mon Sep 17 00:00:00 2001 From: clinton-hall Date: Tue, 15 Apr 2014 15:51:43 +0930 Subject: [PATCH 1/2] fixes for nzbget --- DeleteSamples.py | 4 ++-- ResetDateTime.py | 2 +- nzbToMedia.py | 4 ++-- 3 files changed, 5 insertions(+), 5 deletions(-) diff --git a/DeleteSamples.py b/DeleteSamples.py index f0aa24e1..386d26dc 100755 --- a/DeleteSamples.py +++ b/DeleteSamples.py @@ -3,10 +3,10 @@ # adds lib directory to system path import os import sys -from nzbtomedia.nzbToMediaConfig import config - sys.path.insert(0, os.path.abspath(os.path.join(os.path.dirname(__file__), 'lib'))) +import nzbtomedia + # ############################################################################## ### NZBGET POST-PROCESSING SCRIPT ### diff --git a/ResetDateTime.py b/ResetDateTime.py index 2e4b582e..13e7227b 100755 --- a/ResetDateTime.py +++ b/ResetDateTime.py @@ -5,7 +5,7 @@ import os import sys sys.path.insert(0, os.path.abspath(os.path.join(os.path.dirname(__file__), 'lib'))) -from nzbtomedia.nzbToMediaConfig import config +import nzbtomedia # ############################################################################## diff --git a/nzbToMedia.py b/nzbToMedia.py index 1cdb6b32..250866c7 100755 --- a/nzbToMedia.py +++ b/nzbToMedia.py @@ -439,11 +439,11 @@ def main(): if result == 0: logger.postprocess("The nzbToMedia script completed successfully.") if os.environ.has_key('NZBOP_SCRIPTDIR'): # return code for nzbget v11 - return nzbtomedia.NZBGET_POSTPROCESS_SUCCESS + sys.exit(nzbtomedia.NZBGET_POSTPROCESS_SUCCESS) else: logger.error("A problem was reported in the nzbToMedia script.") if os.environ.has_key('NZBOP_SCRIPTDIR'): # return code for nzbget v11 - return nzbtomedia.NZBGET_POSTPROCESS_ERROR + sys.exit(nzbtomedia.NZBGET_POSTPROCESS_ERROR) return result if __name__ == '__main__': From 10857bef990828c1e0249036d7afe2af45ffd878 Mon Sep 17 00:00:00 2001 From: Clinton Hall Date: Tue, 15 Apr 2014 22:45:15 +0930 Subject: [PATCH 2/2] Process correct directory. Fixes #321 --- TorrentToMedia.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/TorrentToMedia.py b/TorrentToMedia.py index 2870840e..d861b0d5 100755 --- a/TorrentToMedia.py +++ b/TorrentToMedia.py @@ -198,7 +198,7 @@ def processTorrent(inputDirectory, inputName, inputCategory, inputHash, inputID, result = autoProcessTV().processEpisode(outputDestination, inputName, status, clientAgent, inputCategory) elif nzbtomedia.CFG['HeadPhones'][inputCategory]: logger.postprocess("Calling HeadPhones:" + inputCategory + " to post-process: %s", inputName) - result = autoProcessMusic().process(inputDirectory, inputName, status, clientAgent, inputCategory) + result = autoProcessMusic().process(outputDestination, inputName, status, clientAgent, inputCategory) elif nzbtomedia.CFG['Mylar'][inputCategory]: logger.postprocess("Calling Mylar:" + inputCategory + " to post-process: %s", inputName) result = autoProcessComics().processEpisode(outputDestination, inputName, status, clientAgent, inputCategory) @@ -369,4 +369,4 @@ def main(): return result if __name__ == "__main__": - exit(main()) \ No newline at end of file + exit(main())