mirror of
https://github.com/clinton-hall/nzbToMedia.git
synced 2025-08-20 13:23:18 -07:00
Added cleanup of processing folders to start and end of scripts, helps resolve issues where empty folders or misc files left behind cause processing scripts to execute without need.
Modified our listMediaFiles function to allow include/exclude of extension containers so that we can chose what extensions are used to create the results list that gets returned back to us.
This commit is contained in:
parent
9c817af60e
commit
0053fdcf3e
4 changed files with 45 additions and 52 deletions
|
@ -276,13 +276,12 @@
|
|||
import os
|
||||
import sys
|
||||
import nzbtomedia
|
||||
from nzbtomedia.Transcoder import Transcoder
|
||||
from nzbtomedia.autoProcess.autoProcessComics import autoProcessComics
|
||||
from nzbtomedia.autoProcess.autoProcessGames import autoProcessGames
|
||||
from nzbtomedia.autoProcess.autoProcessMovie import autoProcessMovie
|
||||
from nzbtomedia.autoProcess.autoProcessMusic import autoProcessMusic
|
||||
from nzbtomedia.autoProcess.autoProcessTV import autoProcessTV
|
||||
from nzbtomedia.nzbToMediaUtil import get_dirnames, cleanup_directories, listMediaFiles, extractFiles
|
||||
from nzbtomedia.nzbToMediaUtil import get_dirnames, extractFiles, cleanProcDirs
|
||||
from nzbtomedia import logger
|
||||
|
||||
# post-processing
|
||||
|
@ -312,10 +311,6 @@ def process(nzbDir, inputName=None, status=0, clientAgent='manual', download_id=
|
|||
logger.error("We could not find a section with containing a download category labeled %s in your autoProcessMedia.cfg, Exiting!" % inputCategory)
|
||||
result = -1
|
||||
|
||||
if result == 0:
|
||||
# Clean up any leftover files
|
||||
cleanup_directories(inputCategory, section, result, nzbDir)
|
||||
|
||||
return result
|
||||
|
||||
def main(args, section=None):
|
||||
|
@ -432,6 +427,9 @@ def main(args, section=None):
|
|||
logger.debug("nzbToMedia %s:%s is DISABLED" % (section, category))
|
||||
|
||||
if result == 0:
|
||||
# cleanup our processing folders of any misc unwanted files and empty directories
|
||||
cleanProcDirs()
|
||||
|
||||
logger.info("The %s script completed successfully." % args[0])
|
||||
if os.environ.has_key('NZBOP_SCRIPTDIR'): # return code for nzbget v11
|
||||
sys.exit(nzbtomedia.NZBGET_POSTPROCESS_SUCCESS)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue