mirror of
https://github.com/clinton-hall/nzbToMedia.git
synced 2025-08-19 21:03:14 -07:00
We now append the torrent info hash to the output destination folder name, this allows us to re-use it for manual runs if something failed during the post-processing or other future uses.
This commit is contained in:
parent
52b41aa5de
commit
eeca672e00
3 changed files with 17 additions and 5 deletions
|
@ -15,7 +15,7 @@ from nzbtomedia.autoProcess.autoProcessMusic import autoProcessMusic
|
|||
from nzbtomedia.autoProcess.autoProcessTV import autoProcessTV
|
||||
from nzbtomedia.nzbToMediaUtil import category_search, sanitizeFileName, copy_link, parse_args, flatten, get_dirnames, \
|
||||
remove_read_only, pause_torrent, resume_torrent, listMediaFiles, joinPath, \
|
||||
extractFiles, cleanProcDirs
|
||||
extractFiles, cleanProcDirs, append_downloadID
|
||||
from nzbtomedia import logger
|
||||
|
||||
def processTorrent(inputDirectory, inputName, inputCategory, inputHash, inputID, clientAgent):
|
||||
|
@ -48,6 +48,12 @@ def processTorrent(inputDirectory, inputName, inputCategory, inputHash, inputID,
|
|||
if inputCategory == "":
|
||||
inputCategory = "UNCAT"
|
||||
outputDestination = os.path.normpath(joinPath(nzbtomedia.OUTPUTDIRECTORY, inputCategory, sanitizeFileName(inputName)))
|
||||
|
||||
# Add torrent info hash to folder name incase we need it later on
|
||||
if clientAgent != 'manual':
|
||||
logger.debug('Added torrent info hash %s to output directory %s' % (inputHash, outputDestination))
|
||||
outputDestination = append_downloadID(outputDestination, inputHash)
|
||||
|
||||
logger.info("Output directory set to: %s" % (outputDestination))
|
||||
|
||||
processOnly = nzbtomedia.CFG[nzbtomedia.SECTIONS].sections
|
||||
|
@ -152,10 +158,10 @@ def processTorrent(inputDirectory, inputName, inputCategory, inputHash, inputID,
|
|||
logger.error("Something failed! Please check logs. Exiting")
|
||||
return status
|
||||
|
||||
|
||||
if nzbtomedia.CFG['CouchPotato'][inputCategory]:
|
||||
logger.info("Calling CouchPotato:" + inputCategory + " to post-process: %s" % (inputName))
|
||||
download_id = inputHash
|
||||
result = autoProcessMovie().process(outputDestination, inputName, status, clientAgent, download_id, inputCategory)
|
||||
result = autoProcessMovie().process(outputDestination, inputName, status, clientAgent, inputHash, inputCategory)
|
||||
elif nzbtomedia.CFG['SickBeard'][inputCategory]:
|
||||
logger.info("Calling Sick-Beard:" + inputCategory + " to post-process: %s" % (inputName))
|
||||
result = autoProcessTV().processEpisode(outputDestination, inputName, status, clientAgent, inputCategory)
|
||||
|
|
|
@ -702,3 +702,6 @@ def extractFiles(src, dst=None):
|
|||
time.sleep(1)
|
||||
except:
|
||||
logger.debug("Unable to remove file %s" % (inputFile))
|
||||
|
||||
def append_downloadID(dirName, download_id):
|
||||
return '%s.downloadID(%s)' % (dirName,download_id)
|
|
@ -1,9 +1,12 @@
|
|||
import nzbtomedia
|
||||
from nzbtomedia.nzbToMediaUtil import extractFiles
|
||||
from nzbtomedia.nzbToMediaUtil import extractFiles, append_downloadID
|
||||
|
||||
# Initialize the config
|
||||
nzbtomedia.initialize()
|
||||
|
||||
inputDirectory = "Z:\complete\tv\Game.of.Thrones.S04E03.HDTV.XviD-RARBG"
|
||||
inputName = "Game of Thrones - S04E03 - Breaker of Chains"
|
||||
inputHash = 'wdfc8fdn09w1wn908ede0820d8berd434213'
|
||||
|
||||
outputDestination = append_downloadID(inputDirectory, inputHash)
|
||||
print outputDestination
|
Loading…
Add table
Add a link
Reference in a new issue