Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
memoriav
Memobase 2020
services
postprocessing
Media Metadata Indexer
Commits
2598787d
Unverified
Commit
2598787d
authored
Mar 29, 2021
by
Sebastian Schüpbach
Browse files
set access for snippets based on access status of media
Signed-off-by:
Sebastian Schüpbach
<
sebastian.schuepbach@unibas.ch
>
parent
43cf42a6
Pipeline
#23949
failed with stages
in 30 seconds
Changes
1
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
mediametadatatodb_app/resources/MediametadataToDB.py
View file @
2598787d
...
...
@@ -162,7 +162,7 @@ def _extract_dig_obj_vals(msg, access_status) -> dict:
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
"""
...
...
@@ -171,7 +171,7 @@ def _create_audio_snippet_entry(record) -> dict:
logging
.
warning
(
"No duration for audio found: Setting duration to 0"
)
snippet_record
[
'duration'
]
=
0
snippet_record
[
'sig'
]
=
snippet_record
[
'sig'
]
+
'-intro'
snippet_record
[
'access'
]
=
'public'
snippet_record
[
'access'
]
=
access_status
# //@formatter:off
snippet_record
[
'duration'
]
=
\
30
if
_normalize_duration
(
snippet_record
[
'duration'
])
>=
30
\
...
...
@@ -345,7 +345,7 @@ class MediametadataToDB:
if
enriched_data
:
record_processor
.
digital_object_ok
(
record_id
,
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
:
record_processor
.
audio_snippet_ok
(
record_id
,
snippet_entry
)
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment