Skip to content

Commit

Permalink
Update backend filename when backend isn't created on replace (#127)
Browse files Browse the repository at this point in the history
  • Loading branch information
talmo authored Oct 4, 2024
1 parent 8ed557b commit ddf5277
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 0 deletions.
1 change: 1 addition & 0 deletions sleap_io/model/video.py
Original file line number Diff line number Diff line change
Expand Up @@ -316,6 +316,7 @@ def replace_filename(
]

self.filename = new_filename
self.backend_metadata["filename"] = new_filename

if open:
if self.exists():
Expand Down
1 change: 1 addition & 0 deletions tests/model/test_video.py
Original file line number Diff line number Diff line change
Expand Up @@ -115,6 +115,7 @@ def test_video_replace_filename(
video.replace_filename("test.mp4")
assert video.exists() is False
assert video.is_open is False
assert video.backend_metadata["filename"] == "test.mp4"

video.replace_filename(centered_pair_low_quality_path, open=False)
assert video.exists() is True
Expand Down

0 comments on commit ddf5277

Please sign in to comment.