Skip to content

Fix clip scan deduplication by display name#168

Open
justingleader wants to merge 1 commit intonikopueringer:mainfrom
justingleader:codex/fix-scan-dedup
Open

Fix clip scan deduplication by display name#168
justingleader wants to merge 1 commit intonikopueringer:mainfrom
justingleader:codex/fix-scan-dedup

Conversation

@justingleader
Copy link

@justingleader justingleader commented Mar 14, 2026

What does this change?

Fixes a scan bug where scan_clips_dir() deduplicated clips by the user-visible clip.name after metadata had been loaded. If two distinct clips shared the same display name, the later one was silently dropped from the scan results.

This change switches deduplication to the clip's on-disk identity instead, so distinct clips from different projects still appear. It also preserves the existing behavior where a valid folder-backed clip wins over a loose video file with the same stem.

How was it tested?

  • Added regression coverage for two v2 project clips that share the same display name
  • Added regression coverage to preserve the existing folder-over-loose-video behavior
  • Installed the project environment with uv sync --group dev
  • Ran uv run pytest -q (173 passed, 1 skipped)
  • Ran uv run ruff check backend/clip_state.py tests/test_clip_state.py
  • Ran uv run ruff format --check backend/clip_state.py tests/test_clip_state.py

Checklist

  • uv run pytest passes
  • uv run ruff check passes
  • uv run ruff format --check passes

@nikopueringer
Copy link
Owner

I'm not fully understanding the problem being solved here. Can you elaborate for me? I'm not sure if the current behavior is actually causing an issue.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants