Unverified Commit 5e27ef9c authored by Sebastian Schüpbach's avatar Sebastian Schüpbach
Browse files

set status to ignore if no upload happened


Signed-off-by: Sebastian Schüpbach's avatarSebastian Schüpbach <sebastian.schuepbach@unibas.ch>
parent 3da63567
Pipeline #20890 passed with stages
in 1 minute and 39 seconds
......@@ -113,22 +113,26 @@ class RecordProcessor:
audio_snip_msg = \
record['audio_snippet']['msg'] if 'audio_snippet' in record else 'not available'
ok = True
ignored = True
err_msg = ""
if 'digital_object' in record and not record['digital_object']['ignored'] \
and not RecordProcessor._parsing_failed_digital_object(record):
logging.debug(f"Indexing digital object for {key} in DB")
ignored = False
ok, err_msg = self.indexer.insert_in_db(record['digital_object']['data'])
if ok and 'thumbnail' in record and not record['thumbnail']['ignored'] \
and not RecordProcessor._parsing_failed_thumbnail(record):
logging.debug(f"Indexing thumbnail for {key} in DB")
ignored = False
ok, err_msg = self.indexer.insert_in_db(record['thumbnail']['data'])
if ok and 'audio_snippet' in record and not record['audio_snippet']['ignored'] \
and not RecordProcessor._parsing_failed_audio_snippet(record):
logging.debug(f"Indexing audio snippet for {key} in DB")
ignored = False
ok, err_msg = self.indexer.insert_in_db(record['audio_snippet']['data'])
if ok and not RecordProcessor._parsing_errors(record):
self.indexer.commit()
self.reporter.send_message(key, 'SUCCESS',
self.reporter.send_message(key, 'IGNORED' if ignored else 'SUCCESS',
('DIGITAL OBJECT: {} -- THUMBNAIL: {}' +
' -- AUDIO SNIPPET: {}').format(
dig_obj_msg, thumbnail_msg, audio_snip_msg
......
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