Fixes issue #341 and #340

This commit is contained in:
echel0n 2014-04-22 01:49:43 -07:00
commit 3d50c82281
6 changed files with 7 additions and 15 deletions

View file

@ -37,7 +37,8 @@ def processTorrent(inputDirectory, inputName, inputCategory, inputHash, inputID,
"We could not find a section with containing a download category labeled %s in your autoProcessMedia.cfg, Exiting!" % inputCategory) "We could not find a section with containing a download category labeled %s in your autoProcessMedia.cfg, Exiting!" % inputCategory)
return -1 return -1
Torrent_NoLink = int(nzbtomedia.CFG[section][inputCategory]["Torrent_NoLink"]) or 0 try:Torrent_NoLink = int(nzbtomedia.CFG[section][inputCategory]["Torrent_NoLink"])
except:Torrent_NoLink = 0
if clientAgent != 'manual': if clientAgent != 'manual':
pause_torrent(clientAgent, inputHash, inputID, inputName) pause_torrent(clientAgent, inputHash, inputID, inputName)

View file

@ -9,6 +9,7 @@ SYS_ARGV = sys.argv[1:]
APP_FILENAME = sys.argv[0] APP_FILENAME = sys.argv[0]
APP_NAME = os.path.basename(APP_FILENAME) APP_NAME = os.path.basename(APP_FILENAME)
PROGRAM_DIR = os.path.dirname(os.path.normpath(os.path.abspath(os.path.join(__file__, os.pardir)))) PROGRAM_DIR = os.path.dirname(os.path.normpath(os.path.abspath(os.path.join(__file__, os.pardir))))
LIBS_DIR = os.path.join(PROGRAM_DIR, 'lib')
LOG_DIR = os.path.join(PROGRAM_DIR, 'logs') LOG_DIR = os.path.join(PROGRAM_DIR, 'logs')
LOG_FILE = os.path.join(LOG_DIR, 'postprocess.log') LOG_FILE = os.path.join(LOG_DIR, 'postprocess.log')
CONFIG_FILE = os.path.join(PROGRAM_DIR, 'autoProcessMedia.cfg') CONFIG_FILE = os.path.join(PROGRAM_DIR, 'autoProcessMedia.cfg')
@ -17,7 +18,7 @@ CONFIG_MOVIE_FILE = os.path.join(PROGRAM_DIR, 'autoProcessMovie.cfg')
CONFIG_TV_FILE = os.path.join(PROGRAM_DIR, 'autoProcessTv.cfg') CONFIG_TV_FILE = os.path.join(PROGRAM_DIR, 'autoProcessTv.cfg')
# add our custom libs to the system path # add our custom libs to the system path
sys.path.insert(0, os.path.abspath(os.path.join(PROGRAM_DIR, 'lib'))) sys.path.insert(0, LIBS_DIR)
from nzbtomedia import logger, versionCheck from nzbtomedia import logger, versionCheck
from nzbtomedia.nzbToMediaConfig import config from nzbtomedia.nzbToMediaConfig import config

View file

@ -130,9 +130,6 @@ class autoProcessMovie:
imdbid = find_imdbid(dirName, nzbName) imdbid = find_imdbid(dirName, nzbName)
release = self.get_release(baseURL, imdbid, download_id) release = self.get_release(baseURL, imdbid, download_id)
#if not release:
# logger.error('Unable to find %s in your wanted list, skipping ...' % (nzbName), section)
# return 1
# pull info from release found if available # pull info from release found if available
release_id = None release_id = None

View file

@ -56,10 +56,6 @@ class autoProcessTV:
process_method = nzbtomedia.CFG[section][inputCategory]["process_method"] process_method = nzbtomedia.CFG[section][inputCategory]["process_method"]
except: except:
process_method = None process_method = None
try:
Torrent_NoLink = int(nzbtomedia.CFG[section][inputCategory]["Torrent_NoLink"])
except:
Torrent_NoLink = 0
try: try:
remote_path = nzbtomedia.CFG[section][inputCategory]["remote_path"] remote_path = nzbtomedia.CFG[section][inputCategory]["remote_path"]
except: except:
@ -116,7 +112,7 @@ class autoProcessTV:
fork_params[param] = dirName_new fork_params[param] = dirName_new
if param == "process_method": if param == "process_method":
if fork in nzbtomedia.SICKBEARD_TORRENT and Torrent_NoLink == 1 and not clientAgent in ['nzbget','sabnzbd']: #use default SickBeard settings here. if fork in nzbtomedia.SICKBEARD_TORRENT and not clientAgent in ['nzbget','sabnzbd']: #use default SickBeard settings here.
del fork_params[param] del fork_params[param]
if process_method: if process_method:
fork_params[param] = process_method fork_params[param] = process_method

View file

@ -126,9 +126,6 @@ class ConfigObj(configobj.ConfigObj, Section):
if option == "failed_fork": # change this old format if option == "failed_fork": # change this old format
values['failed'] = 'auto' values['failed'] = 'auto'
values.pop(option) values.pop(option)
if option == "Torrent_ForceLink":
values['Torrent_NoLink'] = value
values.pop(option)
if option == "outputDirectory": # move this to new location format if option == "outputDirectory": # move this to new location format
CFG_NEW['Torrent'][option] = os.path.split(os.path.normpath(value))[0] CFG_NEW['Torrent'][option] = os.path.split(os.path.normpath(value))[0]
values.pop(option) values.pop(option)

View file

@ -442,7 +442,7 @@ def cleanProcDirs():
if nzbtomedia.CFG[section][category].isenabled(): if nzbtomedia.CFG[section][category].isenabled():
dirNames = get_dirnames(section, category) dirNames = get_dirnames(section, category)
for dirName in dirNames: for dirName in dirNames:
num_files = len(listMediaFiles(dirName, archives=False)) num_files = len(listMediaFiles(dirName))
if num_files > 0: if num_files > 0:
logger.info( logger.info(
"Directory %s still contains %s unprocessed file(s), skipping ..." % (dirName, num_files), "Directory %s still contains %s unprocessed file(s), skipping ..." % (dirName, num_files),
@ -631,7 +631,7 @@ def find_imdbid(dirName, nzbName):
return imdbid return imdbid
logger.info('Searching IMDB for imdbID ...') logger.info('Searching IMDB for imdbID ...')
guess = guessit.guess_video_info(dirName) guess = guessit.guess_movie_info(nzbName)
if guess: if guess:
# Movie Title # Movie Title
title = None title = None