mirror of
https://github.com/clinton-hall/nzbToMedia.git
synced 2025-08-20 13:23:18 -07:00
Cleaned up log messages for Transcoder and logs
This commit is contained in:
parent
f71321c24a
commit
a183295657
2 changed files with 8 additions and 7 deletions
|
@ -8,7 +8,8 @@ from nzbToMediaUtil import listMediaFiles
|
||||||
|
|
||||||
class Transcoder:
|
class Transcoder:
|
||||||
def isVideoGood(self, videofile):
|
def isVideoGood(self, videofile):
|
||||||
fileName, fileExt = os.path.splitext(videofile)
|
fileNameExt = os.path.basename(videofile)
|
||||||
|
fileName, fileExt = os.path.splitext(fileNameExt)
|
||||||
if fileExt not in nzbtomedia.MEDIACONTAINER:
|
if fileExt not in nzbtomedia.MEDIACONTAINER:
|
||||||
return True
|
return True
|
||||||
|
|
||||||
|
@ -18,22 +19,22 @@ class Transcoder:
|
||||||
bitbucket = open('/dev/null')
|
bitbucket = open('/dev/null')
|
||||||
|
|
||||||
if not nzbtomedia.FFPROBE:
|
if not nzbtomedia.FFPROBE:
|
||||||
logger.error("Cannot detect corrupt video files!, set your ffmpeg_path in your autoProcessMedia.cfg ...")
|
logger.error("Cannot detect corrupt video files!, set your ffmpeg_path in your autoProcessMedia.cfg ...", 'TRANSCODER')
|
||||||
return False
|
return False
|
||||||
|
|
||||||
command = [nzbtomedia.FFPROBE, videofile]
|
command = [nzbtomedia.FFPROBE, videofile]
|
||||||
try:
|
try:
|
||||||
logger.info('Checking if %s has any corruption, please stand by ...' % (videofile))
|
logger.info('Checking [%s] for corruption, please stand by ...' % (fileNameExt), 'TRANSCODER')
|
||||||
result = call(command, stdout=bitbucket, stderr=bitbucket)
|
result = call(command, stdout=bitbucket, stderr=bitbucket)
|
||||||
except:
|
except:
|
||||||
logger.error("Checking video %s for corruption has failed" % (videofile))
|
logger.error("Checking [%s] for corruption has failed" % (fileNameExt), 'TRANSCODER')
|
||||||
return False
|
return False
|
||||||
|
|
||||||
if result == 0:
|
if result == 0:
|
||||||
logger.info("Video %s has no corruption." % (videofile))
|
logger.info("SUCCESS: [%s] has no corruption." % (fileNameExt), 'TRANSCODER')
|
||||||
return True
|
return True
|
||||||
else:
|
else:
|
||||||
logger.error("Video %s is corrupted!" % (videofile))
|
logger.error("FAILED: [%s] is corrupted!" % (fileNameExt), 'TRANSCODER')
|
||||||
return False
|
return False
|
||||||
|
|
||||||
def Transcode_directory(self, dirName):
|
def Transcode_directory(self, dirName):
|
||||||
|
|
|
@ -178,7 +178,7 @@ class NTMRotatingLogHandler(object):
|
||||||
else:
|
else:
|
||||||
self.writes_since_check += 1
|
self.writes_since_check += 1
|
||||||
|
|
||||||
message = u"%s:: %s" % (str(section).upper(), toLog)
|
message = u"%s: %s" % (str(section).upper(), toLog)
|
||||||
|
|
||||||
out_line = message
|
out_line = message
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue