Add duration tolerance logic and pre-download rejection for structured sources (tidal, qobuz, hifi, deezer_dl, amazon) when candidate duration deviates beyond allowed tolerance. Introduces helper functions _duration_tolerance_seconds and _duration_mismatch_exceeds_integrity_tolerance and uses resolve_duration_tolerance from core.imports.file_integrity. Log and skip candidates that would fail post-processing integrity checks to avoid wasted downloads. Update tests to include matching engine stub and new cases covering rejection and acceptance based on duration tolerance; also adjust imports and test fixtures. |
||
|---|---|---|
| .. | ||
| __init__.py | ||
| cancel.py | ||
| candidates.py | ||
| cleanup.py | ||
| history.py | ||
| lifecycle.py | ||
| master.py | ||
| monitor.py | ||
| post_processing.py | ||
| staging.py | ||
| status.py | ||
| task_worker.py | ||
| validation.py | ||
| wishlist_failed.py | ||