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