Skip to content

Commit

Permalink
only call no_transaction_make if video key not present
Browse files Browse the repository at this point in the history
  • Loading branch information
samuelbray32 committed Feb 19, 2024
1 parent 7ecc7d8 commit 459d9cd
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion src/spyglass/position/v1/dlc_utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down

0 comments on commit 459d9cd

Please sign in to comment.