From 459d9cde327c0feeb0d8864f87f780ec00addc00 Mon Sep 17 00:00:00 2001 From: Sam Bray Date: Mon, 19 Feb 2024 10:11:51 -0800 Subject: [PATCH] only call no_transaction_make if video key not present --- src/spyglass/position/v1/dlc_utils.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/spyglass/position/v1/dlc_utils.py b/src/spyglass/position/v1/dlc_utils.py index e2dc1ff04..4d55bd844 100644 --- a/src/spyglass/position/v1/dlc_utils.py +++ b/src/spyglass/position/v1/dlc_utils.py @@ -422,7 +422,8 @@ def get_video_path(key): valid_fields = VideoFile.fetch().dtype.fields.keys() vf_key = {k: val for k, val in key.items() if k in valid_fields} - VideoFile()._no_transaction_make(vf_key, verbose=False) + if not VideoFile & vf_key: + VideoFile()._no_transaction_make(vf_key, verbose=False) video_query = VideoFile & vf_key if len(video_query) != 1: