- view = ViewTrack(
- name=current_view_type,
- view=current_view_type,
- visibility='squish',
- short_label=current_view_type,
- tracktype=str(track['file_type']),
- )
+ attributes = {
+ 'name': current_view_type,
+ 'view': current_view_type,
+ 'visibility': str(track.get('visibility', 'squish')),
+ 'short_label': current_view_type,
+ 'tracktype': str(track['file_type'])
+ }
+ maxHeightPixels = track.get('maxHeightPixels')
+ if maxHeightPixels:
+ attributes['maxHeightPixels'] = str(maxHeightPixels)
+ autoScale = track.get('autoScale')
+ if autoScale:
+ attributes['autoScale'] = str(autoScale)
+ view = ViewTrack(**attributes)