add check_media option. fixes #375

This commit is contained in:
clinton-hall 2014-05-08 11:03:03 +09:30
commit e099a71bc0
7 changed files with 30 additions and 4 deletions

View file

@ -19,6 +19,8 @@
log_db = 0
# Set to where your ffmpeg/ffprobe executables are located
ffmpeg_path =
# Enable/Disable media file checking using ffprobe.
check_media = 1
[CouchPotato]
#### autoProcessing for Movies

View file

@ -19,6 +19,11 @@
# Set to 1 if you want nzbToMedia to automatically check for and update to the latest version
#auto_update=0
# Check Media for corruption (0, 1).
#
# Enable/Disable media file checking using ffprobe.
#check_media=1
## CouchPotato
# CouchPotato script category.

View file

@ -19,6 +19,11 @@
# Set to 1 if you want nzbToMedia to automatically check for and update to the latest version
#auto_update=0
# Check Media for corruption (0, 1).
#
# Enable/Disable media file checking using ffprobe.
#check_media=1
## CouchPotato
# CouchPotato script category.

View file

@ -19,6 +19,11 @@
# Set to 1 if you want nzbToMedia to automatically check for and update to the latest version
#auto_update=0
# Check Media for corruption (0, 1).
#
# Enable/Disable media file checking using ffprobe.
#check_media=1
## NzbDrone
# NzbDrone script category.

View file

@ -19,6 +19,11 @@
# Set to 1 if you want nzbToMedia to automatically check for and update to the latest version
#auto_update=0
# Check Media for corruption (0, 1).
#
# Enable/Disable media file checking using ffprobe.
#check_media=1
# Media Extensions
#
# This is a list of media extensions that are used to verify that the download does contain valid media.

View file

@ -230,6 +230,7 @@ def initialize(section=None):
GIT_BRANCH = CFG['General']['git_branch'] or 'dev'
FORCE_CLEAN = CFG["General"]["force_clean"]
FFMPEG_PATH = CFG["General"]["ffmpeg_path"]
CHECK_MEDIA = int(CFG["General"]["check_Media"]
# Check for updates via GitHUB
if versionCheck.CheckVersion().check_for_new_version():
@ -314,7 +315,7 @@ def initialize(section=None):
logger.warning("Failed to locate ffmpeg.exe, transcoding disabled!")
logger.warning("Install ffmpeg with x264 support to enable this feature ...")
if not (os.path.isfile(FFPROBE)): # problem
if not (os.path.isfile(FFPROBE)) and CHECK_MEDIA: # problem
FFPROBE = None
logger.warning("Failed to locate ffprobe.exe, video corruption detection disabled!")
logger.warning("Install ffmpeg with x264 support to enable this feature ...")
@ -331,7 +332,7 @@ def initialize(section=None):
logger.warning("Failed to locate ffmpeg, transcoding disabled!")
logger.warning("Install ffmpeg with x264 support to enable this feature ...")
if not FFPROBE:
if not FFPROBE and CHECK_MEDIA:
if os.access(os.path.join(FFMPEG_PATH, 'ffprobe'), os.X_OK):
FFPROBE = os.path.join(FFMPEG_PATH, 'ffprobe')
else:
@ -339,6 +340,9 @@ def initialize(section=None):
logger.warning("Failed to locate ffprobe, video corruption detection disabled!")
logger.warning("Install ffmpeg with x264 support to enable this feature ...")
if not CHECK_MEDIA: # allow users to bypass this.
FFPROBE = None
# userscript
map(USER_SCRIPT_CATEGORIES.append, ([subsections[0] for subsections in CFG['UserScript'].items()]))

View file

@ -229,8 +229,8 @@ class ConfigObj(configobj.ConfigObj, Section):
try:
section = "General"
envKeys = ['AUTO_UPDATE']
cfgKeys = ['auto_update']
envKeys = ['AUTO_UPDATE', 'CHECK_MEDIA']
cfgKeys = ['auto_update', 'check_media']
for index in range(len(envKeys)):
key = 'NZBPO_' + envKeys[index]
if os.environ.has_key(key):