Unverified Commit 2598787d authored by Sebastian Schüpbach's avatar Sebastian Schüpbach
Browse files

set access for snippets based on access status of media


Signed-off-by: Sebastian Schüpbach's avatarSebastian Schüpbach <sebastian.schuepbach@unibas.ch>
parent 43cf42a6
Pipeline #23949 failed with stages
in 30 seconds
...@@ -162,7 +162,7 @@ def _extract_dig_obj_vals(msg, access_status) -> dict: ...@@ -162,7 +162,7 @@ def _extract_dig_obj_vals(msg, access_status) -> dict:
return return_values return return_values
def _create_audio_snippet_entry(record) -> dict: def _create_audio_snippet_entry(record, access_status) -> dict:
""" """
Create an audio snippet entry based on the digital object Create an audio snippet entry based on the digital object
""" """
...@@ -171,7 +171,7 @@ def _create_audio_snippet_entry(record) -> dict: ...@@ -171,7 +171,7 @@ def _create_audio_snippet_entry(record) -> dict:
logging.warning("No duration for audio found: Setting duration to 0") logging.warning("No duration for audio found: Setting duration to 0")
snippet_record['duration'] = 0 snippet_record['duration'] = 0
snippet_record['sig'] = snippet_record['sig'] + '-intro' snippet_record['sig'] = snippet_record['sig'] + '-intro'
snippet_record['access'] = 'public' snippet_record['access'] = access_status
# //@formatter:off # //@formatter:off
snippet_record['duration'] = \ snippet_record['duration'] = \
30 if _normalize_duration(snippet_record['duration']) >= 30 \ 30 if _normalize_duration(snippet_record['duration']) >= 30 \
...@@ -345,7 +345,7 @@ class MediametadataToDB: ...@@ -345,7 +345,7 @@ class MediametadataToDB:
if enriched_data: if enriched_data:
record_processor.digital_object_ok(record_id, enriched_data) record_processor.digital_object_ok(record_id, enriched_data)
if _has_audio_snippet(enriched_data): if _has_audio_snippet(enriched_data):
snippet_entry = _create_audio_snippet_entry(enriched_data) snippet_entry = _create_audio_snippet_entry(enriched_data, access_status)
if snippet_entry: if snippet_entry:
record_processor.audio_snippet_ok(record_id, record_processor.audio_snippet_ok(record_id,
snippet_entry) snippet_entry)
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment