mirror of
https://github.com/clinton-hall/nzbToMedia.git
synced 2025-08-20 21:33:13 -07:00
Fixed issue for wrong destination set for cleaning in TorrentToMedia.
Checks for directory exists before attempting to clean it incase processor has already cleaned and removed it.
This commit is contained in:
parent
6594433ca5
commit
eec6ed3b11
2 changed files with 6 additions and 3 deletions
|
@ -202,7 +202,7 @@ def processTorrent(inputDirectory, inputName, inputCategory, inputHash, inputID,
|
|||
nzbtomedia.remove_torrent(clientAgent, inputHash, inputID, inputName)
|
||||
|
||||
# cleanup our processing folders of any misc unwanted files and empty directories
|
||||
nzbtomedia.cleanDir(inputDirectory, sectionName, inputCategory)
|
||||
nzbtomedia.cleanDir(outputDestination, sectionName, inputCategory)
|
||||
|
||||
return result
|
||||
|
||||
|
|
|
@ -457,7 +457,10 @@ def rmDir(dirName):
|
|||
logger.error("Unable to delete folder %s" % (dirName))
|
||||
|
||||
def cleanDir(path, section, subsection):
|
||||
logger.info('Cleaning directory:%s ...' % (path), 'CLEANDIRS')
|
||||
if not os.path.exists(path):
|
||||
logger.info('Directory %s has been processed and removed ...' % (path), 'CLEANDIR')
|
||||
return
|
||||
|
||||
try:
|
||||
minSize = int(nzbtomedia.CFG[section][subsection]['minSize'])
|
||||
except:minSize = 0
|
||||
|
@ -471,7 +474,7 @@ def cleanDir(path, section, subsection):
|
|||
"Directory %s still contains %s unprocessed file(s), skipping ..." % (path, num_files),
|
||||
'CLEANDIRS')
|
||||
|
||||
logger.info("Directory %s has already been processed, removing ..." % (path), 'CLEANDIRS')
|
||||
logger.info("Directory %s has been processed, removing ..." % (path), 'CLEANDIRS')
|
||||
shutil.rmtree(path)
|
||||
|
||||
def create_torrent_class(clientAgent):
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue