Skip to content

Commit

Permalink
WIP on #171.
Browse files Browse the repository at this point in the history
  • Loading branch information
mjordan committed Apr 6, 2021
1 parent 8d1cf75 commit 58d239e
Showing 1 changed file with 7 additions and 5 deletions.
12 changes: 7 additions & 5 deletions workbench_utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -152,8 +152,10 @@ def set_config_defaults(args):
extracted_text = collections.OrderedDict({'extracted_text': ['txt']})
config['media_types'].append(extracted_text)

# Set defaults for media fields in media type bunldes, then if 'media_fields' option is present
# in config file, determine which field to use for the file, per media bundle type.
# Set config['media_bundle_file_fields']. If 'media_fields' option is present in
# the config file, determine which field to use for the file, per media bundle.
# Note that 'media_file_fields' is the option used in the config file, and that
# config['media_bundle_file_fields'] is the internal name of the setting.
media_fields = dict({
'file': 'field_media_file',
'document': 'field_media_document',
Expand All @@ -163,14 +165,14 @@ def set_config_defaults(args):
'extracted_text': 'field_media_file',
'fits_technical_metadata': 'field_media_file'
})
if 'media_fields' in config:
for media_field in config['media_fields']:
if 'media_file_fields' in config:
for media_field in config['media_file_fields']:
for media_type, media_field in media_field.items():
media_fields[media_type] = media_field
else:
config['media_fields'] = media_fields

config['media_bundle_media_fields'] = media_fields
config['media_bundle_file_fields'] = media_fields

if config['task'] == 'create':
if 'paged_content_sequence_seprator' not in config:
Expand Down

0 comments on commit 58d239e

Please sign in to comment.