Unverified Commit 1e02c5f1 authored by Sebastian Schüpbach's avatar Sebastian Schüpbach
Browse files

read resource type directly from metadata


Signed-off-by: Sebastian Schüpbach's avatarSebastian Schüpbach <sebastian.schuepbach@unibas.ch>
parent c264dd86
......@@ -73,17 +73,8 @@ def _get_values_from_digital_object(msg):
duration = msg['duration']
returnValues['duration'] = duration
# if uri uses a play to show content, use a special 'type':
if 'zem.ch/' in uri:
type = 'zem'
elif 'vimeo.com/' in uri:
type = 'vimeo'
elif 'youtube.com' in uri or 'youtu.be' in uri:
type = 'youtube'
elif '???/' in uri and type == 'audio':
type = 'srfaudio'
elif '???/' in uri and type == 'video':
type = 'srfvideo'
returnValues['type'] = type
if 'isDistributedOn' in msg:
returnValues['type'] = msg['isDistributedOn']
return returnValues
......@@ -112,8 +103,6 @@ def _create_metadata_entry(record, mariadbCursor):
def _has_audio_snippet(record):
# FIXME: Needs probably improvements as soon as we have
# a reliable technique to distinguish sources of media files
return record['type'] == 'audio' and \
'uri' in record and \
record['uri'].startswith('file://')
......
Supports Markdown
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