mirror of
https://github.com/clinton-hall/nzbToMedia.git
synced 2025-08-19 21:03:14 -07:00
This commit is contained in:
parent
0eadf394c1
commit
8e073de00a
5 changed files with 10 additions and 7 deletions
|
@ -161,7 +161,7 @@ class autoProcessMovie:
|
||||||
if os.path.isdir(SpecificPath):
|
if os.path.isdir(SpecificPath):
|
||||||
dirName = SpecificPath
|
dirName = SpecificPath
|
||||||
|
|
||||||
process_all_exceptions(inputName.lower(), dirName)
|
process_all_exceptions(inputName, dirName)
|
||||||
inputName, dirName = convert_to_ascii(inputName, dirName)
|
inputName, dirName = convert_to_ascii(inputName, dirName)
|
||||||
|
|
||||||
if not listMediaFiles(dirName, media=True, audio=False, meta=False, archives=False) and listMediaFiles(dirName, media=False, audio=False, meta=False, archives=True) and extract:
|
if not listMediaFiles(dirName, media=True, audio=False, meta=False, archives=False) and listMediaFiles(dirName, media=False, audio=False, meta=False, archives=True) and extract:
|
||||||
|
|
|
@ -77,7 +77,7 @@ class autoProcessMusic:
|
||||||
if os.path.isdir(SpecificPath):
|
if os.path.isdir(SpecificPath):
|
||||||
dirName = SpecificPath
|
dirName = SpecificPath
|
||||||
|
|
||||||
process_all_exceptions(inputName.lower(), dirName)
|
process_all_exceptions(inputName, dirName)
|
||||||
inputName, dirName = convert_to_ascii(inputName, dirName)
|
inputName, dirName = convert_to_ascii(inputName, dirName)
|
||||||
|
|
||||||
if not listMediaFiles(dirName, media=False, audio=True, meta=False, archives=False) and listMediaFiles(dirName, media=False, audio=False, meta=False, archives=True) and extract:
|
if not listMediaFiles(dirName, media=False, audio=True, meta=False, archives=False) and listMediaFiles(dirName, media=False, audio=False, meta=False, archives=True) and extract:
|
||||||
|
|
|
@ -136,7 +136,7 @@ class autoProcessTV:
|
||||||
|
|
||||||
if fork not in nzbtomedia.SICKBEARD_TORRENT or (clientAgent in ['nzbget','sabnzbd'] and nzbExtractionBy != "Destination"):
|
if fork not in nzbtomedia.SICKBEARD_TORRENT or (clientAgent in ['nzbget','sabnzbd'] and nzbExtractionBy != "Destination"):
|
||||||
if inputName:
|
if inputName:
|
||||||
process_all_exceptions(inputName.lower(), dirName)
|
process_all_exceptions(inputName, dirName)
|
||||||
inputName, dirName = convert_to_ascii(inputName, dirName)
|
inputName, dirName = convert_to_ascii(inputName, dirName)
|
||||||
|
|
||||||
# Now check if tv files exist in destination.
|
# Now check if tv files exist in destination.
|
||||||
|
|
|
@ -61,6 +61,8 @@ def autoFork(section, inputCategory):
|
||||||
fork = ['default', {}]
|
fork = ['default', {}]
|
||||||
|
|
||||||
elif fork == "auto":
|
elif fork == "auto":
|
||||||
|
params = nzbtomedia.ALL_FORKS
|
||||||
|
rem_params = []
|
||||||
logger.info("Attempting to auto-detect %s fork" % inputCategory)
|
logger.info("Attempting to auto-detect %s fork" % inputCategory)
|
||||||
# define the order to test. Default must be first since the default fork doesn't reject parameters.
|
# define the order to test. Default must be first since the default fork doesn't reject parameters.
|
||||||
# then in order of most unique parameters.
|
# then in order of most unique parameters.
|
||||||
|
@ -74,8 +76,6 @@ def autoFork(section, inputCategory):
|
||||||
except requests.ConnectionError:
|
except requests.ConnectionError:
|
||||||
logger.info("Could not connect to %s:%s to perform auto-fork detection!" % (section, inputCategory))
|
logger.info("Could not connect to %s:%s to perform auto-fork detection!" % (section, inputCategory))
|
||||||
if r.ok:
|
if r.ok:
|
||||||
params = nzbtomedia.ALL_FORKS
|
|
||||||
rem_params = []
|
|
||||||
for param in params:
|
for param in params:
|
||||||
if not 'name="%s"' %(param) in r.text:
|
if not 'name="%s"' %(param) in r.text:
|
||||||
rem_params.append(param)
|
rem_params.append(param)
|
||||||
|
@ -87,6 +87,9 @@ def autoFork(section, inputCategory):
|
||||||
break
|
break
|
||||||
if detected:
|
if detected:
|
||||||
logger.info("%s:%s fork auto-detection successful ..." % (section, inputCategory))
|
logger.info("%s:%s fork auto-detection successful ..." % (section, inputCategory))
|
||||||
|
elif rem_params:
|
||||||
|
logger.info("%s:%s fork auto-detection found custom params %s" % (section, inputCategory, params))
|
||||||
|
fork = ['custom', params]
|
||||||
else:
|
else:
|
||||||
logger.info("%s:%s fork auto-detection failed" % (section, inputCategory))
|
logger.info("%s:%s fork auto-detection failed" % (section, inputCategory))
|
||||||
fork = nzbtomedia.FORKS.items()[nzbtomedia.FORKS.keys().index(nzbtomedia.FORK_DEFAULT)]
|
fork = nzbtomedia.FORKS.items()[nzbtomedia.FORKS.keys().index(nzbtomedia.FORK_DEFAULT)]
|
||||||
|
|
|
@ -32,10 +32,10 @@ def process_all_exceptions(name, dirname):
|
||||||
|
|
||||||
def replace_filename(filename, dirname, name):
|
def replace_filename(filename, dirname, name):
|
||||||
head, fileExtension = os.path.splitext(os.path.basename(filename))
|
head, fileExtension = os.path.splitext(os.path.basename(filename))
|
||||||
if media_pattern.search(os.path.basename(dirname)) is not None:
|
if media_pattern.search(os.path.basename(dirname).replace(' ','.')) is not None:
|
||||||
newname = os.path.basename(dirname)
|
newname = os.path.basename(dirname)
|
||||||
logger.debug("Replacing file name %s with directory name %s" % (head, newname), "EXCEPTION")
|
logger.debug("Replacing file name %s with directory name %s" % (head, newname), "EXCEPTION")
|
||||||
elif media_pattern.search(name) is not None:
|
elif media_pattern.search(name.replace(' ','.').lower()) is not None:
|
||||||
newname = name
|
newname = name
|
||||||
logger.debug("Replacing file name %s with download name %s" % (head, newname), "EXCEPTION")
|
logger.debug("Replacing file name %s with download name %s" % (head, newname), "EXCEPTION")
|
||||||
else:
|
else:
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue