Skip to content
Snippets Groups Projects

Retrieve transcriptions from local cache in list_transcriptions

Merged Eva Bardou requested to merge retrieve-cached-transcriptions into master
All threads resolved!
1 file
+ 5
8
Compare changes
  • Side-by-side
  • Inline
+ 5
8
@@ -941,16 +941,13 @@ class ElementsWorker(BaseWorker):
"worker_version",
}, "When using the local cache, you can only filter by 'worker_version'"
conditions = [("element_id", "=", convert_str_uuid_to_hex(element.id))]
transcriptions = CachedTranscription.select().where(
CachedTranscription.element_id == element.id
)
if worker_version:
conditions.append(
("worker_version_id", "=", convert_str_uuid_to_hex(worker_version))
transcriptions = transcriptions.where(
CachedTranscription.worker_version_id == worker_version
)
transcriptions = self.cache.fetch(
"transcriptions",
where=conditions,
)
else:
if self.cache:
logger.warning(
Loading