mirror of
https://github.com/clinton-hall/nzbToMedia.git
synced 2025-08-20 05:13:16 -07:00
change handling of SB_Torrent.
This commit is contained in:
parent
fc7ba70c6a
commit
e3bb60aa57
4 changed files with 13 additions and 20 deletions
|
@ -40,7 +40,7 @@ def main(inputDirectory, inputName, inputCategory, inputHash, inputID):
|
||||||
|
|
||||||
sbFork, sbParams = autoFork()
|
sbFork, sbParams = autoFork()
|
||||||
|
|
||||||
if inputCategory in sbCategory and sbFork in SICKBEARD_TORRENT and Torrent_ForceLink != 1:
|
if inputCategory in sbCategory and sbFork in SICKBEARD_TORRENT and Torrent_NoLink == 1:
|
||||||
Logger.info("MAIN: Calling SickBeard's %s branch to post-process: %s",sbFork ,inputName)
|
Logger.info("MAIN: Calling SickBeard's %s branch to post-process: %s",sbFork ,inputName)
|
||||||
result = autoProcessTV.processEpisode(inputDirectory, inputName, int(0))
|
result = autoProcessTV.processEpisode(inputDirectory, inputName, int(0))
|
||||||
if result == 1:
|
if result == 1:
|
||||||
|
@ -121,8 +121,6 @@ def main(inputDirectory, inputName, inputCategory, inputHash, inputID):
|
||||||
Logger.debug("MAIN: Scanning files in directory: %s", inputDirectory)
|
Logger.debug("MAIN: Scanning files in directory: %s", inputDirectory)
|
||||||
|
|
||||||
noFlatten.extend(hpCategory) # Make sure we preserve folder structure for HeadPhones.
|
noFlatten.extend(hpCategory) # Make sure we preserve folder structure for HeadPhones.
|
||||||
if inputCategory in sbCategory and sbFork in SICKBEARD_TORRENT: # Don't flatten when sending to SICKBEARD_TORRENT
|
|
||||||
noFlatten.extend(sbCategory)
|
|
||||||
|
|
||||||
outputDestinationMaster = outputDestination # Save the original, so we can change this within the loop below, and reset afterwards.
|
outputDestinationMaster = outputDestination # Save the original, so we can change this within the loop below, and reset afterwards.
|
||||||
now = datetime.datetime.now()
|
now = datetime.datetime.now()
|
||||||
|
@ -163,15 +161,6 @@ def main(inputDirectory, inputName, inputCategory, inputHash, inputID):
|
||||||
else:
|
else:
|
||||||
continue # This file has not been recently moved or created, skip it
|
continue # This file has not been recently moved or created, skip it
|
||||||
|
|
||||||
if inputCategory in sbCategory and sbFork in SICKBEARD_TORRENT: # We want to link every file.
|
|
||||||
Logger.info("MAIN: Found file %s in %s", fileExtension, filePath)
|
|
||||||
try:
|
|
||||||
copy_link(filePath, targetDirectory, useLink, outputDestination)
|
|
||||||
copy_list.append([filePath, os.path.join(outputDestination, file)])
|
|
||||||
except:
|
|
||||||
Logger.exception("MAIN: Failed to link file: %s", file)
|
|
||||||
continue
|
|
||||||
|
|
||||||
if fileExtension in mediaContainer: # If the file is a video file
|
if fileExtension in mediaContainer: # If the file is a video file
|
||||||
if is_sample(filePath, inputName, minSampleSize, SampleIDs) and not inputCategory in hpCategory: # Ignore samples
|
if is_sample(filePath, inputName, minSampleSize, SampleIDs) and not inputCategory in hpCategory: # Ignore samples
|
||||||
Logger.info("MAIN: Ignoring sample file: %s ", filePath)
|
Logger.info("MAIN: Ignoring sample file: %s ", filePath)
|
||||||
|
@ -223,7 +212,7 @@ def main(inputDirectory, inputName, inputCategory, inputHash, inputID):
|
||||||
flatten(outputDestination)
|
flatten(outputDestination)
|
||||||
|
|
||||||
# Now check if movie files exist in destination:
|
# Now check if movie files exist in destination:
|
||||||
if inputCategory in cpsCategory + sbCategory and not (inputCategory in sbCategory and sbFork in SICKBEARD_TORRENT):
|
if inputCategory in cpsCategory + sbCategory:
|
||||||
for dirpath, dirnames, filenames in os.walk(outputDestination):
|
for dirpath, dirnames, filenames in os.walk(outputDestination):
|
||||||
for file in filenames:
|
for file in filenames:
|
||||||
filePath = os.path.join(dirpath, file)
|
filePath = os.path.join(dirpath, file)
|
||||||
|
@ -243,10 +232,6 @@ def main(inputDirectory, inputName, inputCategory, inputHash, inputID):
|
||||||
else:
|
else:
|
||||||
Logger.debug("MAIN: Found %s media files in output. %s were found in input", str(video2), str(video))
|
Logger.debug("MAIN: Found %s media files in output. %s were found in input", str(video2), str(video))
|
||||||
|
|
||||||
if inputCategory in sbCategory and sbFork in SICKBEARD_TORRENT:
|
|
||||||
if len(copy_list) > 0:
|
|
||||||
Logger.debug("MAIN: Found and linked %s files", str(len(copy_list)))
|
|
||||||
status = int(0)
|
|
||||||
|
|
||||||
processCategories = cpsCategory + sbCategory + hpCategory + mlCategory + gzCategory
|
processCategories = cpsCategory + sbCategory + hpCategory + mlCategory + gzCategory
|
||||||
|
|
||||||
|
@ -449,7 +434,7 @@ if __name__ == "__main__":
|
||||||
|
|
||||||
cpsCategory = (config().get("CouchPotato", "cpsCategory")).split(',') # movie
|
cpsCategory = (config().get("CouchPotato", "cpsCategory")).split(',') # movie
|
||||||
sbCategory = (config().get("SickBeard", "sbCategory")).split(',') # tv
|
sbCategory = (config().get("SickBeard", "sbCategory")).split(',') # tv
|
||||||
Torrent_ForceLink = int(config().get("SickBeard", "Torrent_ForceLink")) # 1
|
Torrent_NoLink = int(config().get("SickBeard", "Torrent_NoLink")) # 0
|
||||||
hpCategory = (config().get("HeadPhones", "hpCategory")).split(',') # music
|
hpCategory = (config().get("HeadPhones", "hpCategory")).split(',') # music
|
||||||
mlCategory = (config().get("Mylar", "mlCategory")).split(',') # comics
|
mlCategory = (config().get("Mylar", "mlCategory")).split(',') # comics
|
||||||
gzCategory = (config().get("Gamez", "gzCategory")).split(',') # games
|
gzCategory = (config().get("Gamez", "gzCategory")).split(',') # games
|
||||||
|
|
|
@ -98,6 +98,10 @@ def processEpisode(dirName, nzbName=None, failed=False, clientAgent = "manual",
|
||||||
process_method = config().get(section, "process_method")
|
process_method = config().get(section, "process_method")
|
||||||
except config.NoOptionError:
|
except config.NoOptionError:
|
||||||
process_method = None
|
process_method = None
|
||||||
|
try:
|
||||||
|
Torrent_NoLink = int(config().get(section, "Torrent_NoLink"))
|
||||||
|
except (config.NoOptionError, ValueError):
|
||||||
|
Torrent_NoLink = 0
|
||||||
|
|
||||||
mediaContainer = (config().get("Extensions", "mediaExtensions")).split(',')
|
mediaContainer = (config().get("Extensions", "mediaExtensions")).split(',')
|
||||||
minSampleSize = int(config().get("Extensions", "minSampleSize"))
|
minSampleSize = int(config().get("Extensions", "minSampleSize"))
|
||||||
|
@ -160,7 +164,9 @@ def processEpisode(dirName, nzbName=None, failed=False, clientAgent = "manual",
|
||||||
params[param] = dirName
|
params[param] = dirName
|
||||||
|
|
||||||
if param == "process_method":
|
if param == "process_method":
|
||||||
if process_method:
|
if fork in SICKBEARD_TORRENT and Torrent_NoLink == 1 and not clientAgent in ['nzbget','sabnzbd']: #use default SickBeard settings here.
|
||||||
|
del params[param]
|
||||||
|
elif process_method:
|
||||||
params[param] = process_method
|
params[param] = process_method
|
||||||
else:
|
else:
|
||||||
del params[param]
|
del params[param]
|
||||||
|
|
|
@ -31,6 +31,8 @@ def migrate():
|
||||||
value = "auto"
|
value = "auto"
|
||||||
if option == "fork" and value not in ["default", "failed", "failed-torrent", "auto"]:
|
if option == "fork" and value not in ["default", "failed", "failed-torrent", "auto"]:
|
||||||
value = "auto"
|
value = "auto"
|
||||||
|
if option == "Torrent_ForceLink":
|
||||||
|
continue
|
||||||
if option == "outputDirectory": # move this to new location format
|
if option == "outputDirectory": # move this to new location format
|
||||||
value = os.path.split(os.path.normpath(value))[0]
|
value = os.path.split(os.path.normpath(value))[0]
|
||||||
confignew.set("Torrent", option, value)
|
confignew.set("Torrent", option, value)
|
||||||
|
|
|
@ -37,7 +37,7 @@ watch_dir =
|
||||||
fork = auto
|
fork = auto
|
||||||
delete_failed = 0
|
delete_failed = 0
|
||||||
nzbExtractionBy = Downloader
|
nzbExtractionBy = Downloader
|
||||||
Torrent_ForceLink = 1
|
Torrent_NoLink = 0
|
||||||
process_method =
|
process_method =
|
||||||
|
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue