refactor(probe): consolidate full probe() into MediaProber port
Add probe(video) -> MediaInfo | None to the MediaProber Protocol and implement it on FfprobeMediaProber. The standalone alfred/infrastructure/filesystem/ffprobe.py module is removed; all callers (analyze_release / probe_media tools, testing scripts) now go through the adapter. Tests for the probe path moved to tests/infrastructure/test_ffprobe_prober.py (patching subprocess.run at the adapter module level). Unblocks the upcoming inspect_release orchestrator, which needs the port — not a free function — to compose parse + main-video selection + probe in one shot.
This commit is contained in:
@@ -9,7 +9,10 @@ from __future__ import annotations
|
||||
|
||||
from dataclasses import dataclass
|
||||
from pathlib import Path
|
||||
from typing import Protocol
|
||||
from typing import TYPE_CHECKING, Protocol
|
||||
|
||||
if TYPE_CHECKING:
|
||||
from alfred.domain.shared.media import MediaInfo
|
||||
|
||||
|
||||
@dataclass(frozen=True)
|
||||
@@ -37,3 +40,13 @@ class MediaProber(Protocol):
|
||||
no subtitle streams. Adapters must not raise.
|
||||
"""
|
||||
...
|
||||
|
||||
def probe(self, video: Path) -> MediaInfo | None:
|
||||
"""Return the full :class:`MediaInfo` for ``video``, or ``None``.
|
||||
|
||||
Covers all stream families (video, audio, subtitle) plus
|
||||
file-level duration / bitrate. ``None`` signals that ffprobe is
|
||||
unavailable or the file can't be read — adapters must not
|
||||
raise.
|
||||
"""
|
||||
...
|
||||
|
||||
Reference in New Issue
Block a user