mirror of
https://github.com/clinton-hall/nzbToMedia.git
synced 2025-08-14 02:26:53 -07:00
Fixed issues with checking for video corruption
This commit is contained in:
parent
2391f4a5de
commit
d511b54e66
13 changed files with 145 additions and 256 deletions
|
@ -20,7 +20,11 @@ class autoProcessTV:
|
|||
# auto-detect correct fork
|
||||
fork, fork_params = autoFork(inputCategory)
|
||||
|
||||
# Check video files for corruption
|
||||
status = int(failed)
|
||||
for video in listMediaFiles(dirName):
|
||||
if not Transcoder().isVideoGood(video):
|
||||
status = 1
|
||||
|
||||
host = nzbtomedia.CFG[section][inputCategory]["host"]
|
||||
port = nzbtomedia.CFG[section][inputCategory]["port"]
|
||||
|
@ -40,9 +44,9 @@ class autoProcessTV:
|
|||
except:
|
||||
web_root = ""
|
||||
try:
|
||||
rmDir_failed = int(nzbtomedia.CFG[section][inputCategory]["rmDir_failed"])
|
||||
delete_failed = int(nzbtomedia.CFG[section][inputCategory]["rmDir_failed"])
|
||||
except:
|
||||
rmDir_failed = 0
|
||||
delete_failed = 0
|
||||
try:
|
||||
nzbExtractionBy = nzbtomedia.CFG[section][inputCategory]["nzbExtractionBy"]
|
||||
except:
|
||||
|
@ -128,7 +132,7 @@ class autoProcessTV:
|
|||
logger.postprocess("FAILED: The download failed. Sending 'failed' process request to %s branch" % (fork), section)
|
||||
else:
|
||||
logger.postprocess("FAILED: The download failed. %s branch does not handle failed downloads. Nothing to process" % (fork), section)
|
||||
if rmDir_failed and os.path.isdir(dirName) and not os.path.dirname(dirName) == dirName:
|
||||
if delete_failed and os.path.isdir(dirName) and not os.path.dirname(dirName) == dirName:
|
||||
logger.postprocess("Deleting failed files and folder %s" % (dirName), section)
|
||||
rmDir(dirName)
|
||||
return 0 # Success (as far as this script is concerned)
|
||||
|
@ -168,7 +172,7 @@ class autoProcessTV:
|
|||
for line in r.iter_lines():
|
||||
if line: logger.postprocess("%s" % (line), section)
|
||||
|
||||
if status != 0 and rmDir_failed and not os.path.dirname(dirName) == dirName:
|
||||
if status != 0 and delete_failed and not os.path.dirname(dirName) == dirName:
|
||||
logger.postprocess("Deleting failed files and folder %s" % (dirName),section)
|
||||
rmDir(dirName)
|
||||
return 0 # Success
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue