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
|
@ -4,7 +4,7 @@ import nzbtomedia
|
|||
from lib import requests
|
||||
from nzbtomedia.Transcoder import Transcoder
|
||||
from nzbtomedia.nzbToMediaSceneExceptions import process_all_exceptions
|
||||
from nzbtomedia.nzbToMediaUtil import convert_to_ascii, rmDir, find_imdbid, find_download, joinPath
|
||||
from nzbtomedia.nzbToMediaUtil import convert_to_ascii, rmDir, find_imdbid, find_download, joinPath, listMediaFiles
|
||||
from nzbtomedia import logger
|
||||
|
||||
|
||||
|
@ -90,13 +90,17 @@ class autoProcessMovie:
|
|||
"We were unable to find a section for category %s, please check your autoProcessMedia.cfg file." % inputCategory)
|
||||
return 1
|
||||
|
||||
# Check video files for corruption
|
||||
status = int(status)
|
||||
for video in listMediaFiles(dirName):
|
||||
if not Transcoder().isVideoGood(video):
|
||||
status = 1
|
||||
|
||||
host = nzbtomedia.CFG[section][inputCategory]["host"]
|
||||
port = nzbtomedia.CFG[section][inputCategory]["port"]
|
||||
apikey = nzbtomedia.CFG[section][inputCategory]["apikey"]
|
||||
method = nzbtomedia.CFG[section][inputCategory]["method"]
|
||||
rmDir_failed = int(nzbtomedia.CFG[section][inputCategory]["rmDir_failed"])
|
||||
delete_failed = int(nzbtomedia.CFG[section][inputCategory]["delete_failed"])
|
||||
wait_for = int(nzbtomedia.CFG[section][inputCategory]["wait_for"])
|
||||
|
||||
try:
|
||||
|
@ -186,7 +190,7 @@ class autoProcessMovie:
|
|||
else:
|
||||
logger.postprocess("FAILED DOWNLOAD DETECTED FOR %s" % (nzbName), 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)
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue