check medium_size arg in skip_transcoding, not config
This commit is contained in:
parent
882779f547
commit
8bb0df62d4
@ -125,7 +125,7 @@ class CommonVideoProcessor(MediaProcessor):
|
||||
|
||||
def common_setup(self):
|
||||
self.video_config = mgg \
|
||||
.global_config['media_type:mediagoblin.media_types.audio']
|
||||
.global_config['media_type:mediagoblin.media_types.video']
|
||||
|
||||
# Pull down and set up the original file
|
||||
self.orig_filename = get_orig_filename(
|
||||
@ -166,7 +166,7 @@ class CommonVideoProcessor(MediaProcessor):
|
||||
|
||||
# Figure out whether or not we need to transcode this video or
|
||||
# if we can skip it
|
||||
if skip_transcode(metadata):
|
||||
if skip_transcode(metadata, medium_size):
|
||||
_log.debug('Skipping transcoding')
|
||||
|
||||
dst_dimensions = metadata['videowidth'], metadata['videoheight']
|
||||
@ -314,7 +314,8 @@ class Resizer(CommonVideoProcessor):
|
||||
parser.add_argument(
|
||||
'file',
|
||||
nargs='?',
|
||||
default='thumb')
|
||||
default='thumb',
|
||||
choices=['thumb'])
|
||||
|
||||
return parser
|
||||
|
||||
|
@ -21,7 +21,7 @@ from mediagoblin import mg_globals as mgg
|
||||
_log = logging.getLogger(__name__)
|
||||
|
||||
|
||||
def skip_transcode(metadata):
|
||||
def skip_transcode(metadata, size):
|
||||
'''
|
||||
Checks video metadata against configuration values for skip_transcode.
|
||||
|
||||
@ -51,9 +51,9 @@ def skip_transcode(metadata):
|
||||
return False
|
||||
|
||||
if config['dimensions_match']:
|
||||
if not metadata['videoheight'] <= medium_config['max_height']:
|
||||
if not metadata['videoheight'] <= size[1]:
|
||||
return False
|
||||
if not metadata['videowidth'] <= medium_config['max_width']:
|
||||
if not metadata['videowidth'] <= size[0]:
|
||||
return False
|
||||
|
||||
return True
|
||||
|
Loading…
x
Reference in New Issue
Block a user