Exclude dotfiles from project video and pose file discovery#410
Open
gbeane wants to merge 1 commit into
Open
Conversation
Contributor
There was a problem hiding this comment.
Pull request overview
This PR fixes a macOS-on-external-drive crash during JABS project discovery by ensuring leading-dot “sidecar” files (notably AppleDouble ._*) are ignored when scanning for videos and validating project structure.
Changes:
- Update
VideoManager.get_videos()to skip dotfiles during video discovery. - Update
ProjectPaths.create_directories()validation to ignore dotfile videos and pose HDF5 sidecars. - Add tests covering both dotfile exclusion and validation behavior for real vs. sidecar-only directories.
Reviewed changes
Copilot reviewed 4 out of 4 changed files in this pull request and generated no comments.
| File | Description |
|---|---|
| tests/project/test_video_manager.py | Adds regression test ensuring get_videos() excludes dotfiles (including AppleDouble sidecars). |
| tests/project/test_project_paths.py | Adds validation tests to ensure dotfile-only directories are rejected and real projects pass even with sidecars present. |
| src/jabs/project/video_manager.py | Filters out dotfile entries during video enumeration to avoid treating AppleDouble sidecars as videos. |
| src/jabs/project/project_paths.py | Filters out dotfiles during “has_video/has_pose” validation so sidecar-only dirs don’t look like valid projects. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Initializing or loading a JABS project stored on a macOS external drive (exFAT/NTFS)
crashed during the video scan with:
macOS writes an AppleDouble sidecar (
._<name>) next to every file on non-APFS/HFS+volumes. Unlike the shell,
pathlib.Path.glob("*")matches these leading-dot files, sothe scan treated
._video.mp4as a real video and handed its companion._video_pose_est_v8.h5sidecar (which is not valid HDF5) toh5py.Fix
Skip dotfiles at the two directory-discovery sites:
VideoManager.get_videos()no longer returns names beginning with..ProjectPaths.create_directories()validation (has_video/has_pose) ignoresdotfiles, so a directory containing only sidecars is correctly rejected as "not a valid
JABS project" instead of falsely passing.
Tests
test_video_manager.py::test_get_videos_excludes_dotfilestest_project_paths.py::test_create_directories_ignores_dotfile_videos_and_posestest_project_paths.py::test_create_directories_validates_real_project