fix(probe): do not hide prober failures or cover art
Review on #59. select_feature skipped every probe error, so a missing ffprobe or a timeout reported "no video file" for a torrent that has one; only per-file content failures are skipped now. And an audio file with embedded artwork reports the cover as a video stream, which made a soundtrack look importable. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
This commit is contained in:
co-authored by
Claude Opus 5
parent
3927927466
commit
4e880413ae
@@ -95,3 +95,24 @@ pub enum Error {
|
||||
#[error("no video file among the candidates")]
|
||||
NoCandidates,
|
||||
}
|
||||
|
||||
impl Error {
|
||||
/// Whether this failure is a fact about one file rather than about the
|
||||
/// prober.
|
||||
///
|
||||
/// Feature selection walks a torrent full of `.nfo`, `.jpg` and `.txt`
|
||||
/// files, so a file that is not importable media is expected and gets
|
||||
/// skipped. A missing binary, a timeout or unparseable output is not about
|
||||
/// the file at all, and swallowing it would report "no video file" for a
|
||||
/// torrent that has one.
|
||||
#[must_use]
|
||||
pub const fn is_about_the_file(&self) -> bool {
|
||||
matches!(
|
||||
self,
|
||||
Self::Rejected { .. }
|
||||
| Self::NotVideo { .. }
|
||||
| Self::NoVideoStream { .. }
|
||||
| Self::NoDuration { .. }
|
||||
)
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user