Normalize segmented cache coverage

This commit is contained in:
Melbar
2026-05-02 14:11:27 +02:00
parent e6bd0faf03
commit 858a814db1
2 changed files with 10 additions and 1 deletions
+6 -1
View File
@@ -218,7 +218,12 @@ def _normalize_cached_results(beats: list, results: list, cfg) -> list:
if weighted_score < cfg.cv.deep_scan.provisional_match_threshold:
continue
if beat is not None and beat.duration_s > 0:
coverage = segment_duration / beat.duration_s
visible_duration = sum(
max(0.0, end_s - start_s)
for start_s, end_s in _reference_scoreable_segments(beat, cfg)
)
coverage_target = visible_duration if visible_duration > 0 else beat.duration_s
coverage = segment_duration / coverage_target
if coverage < cfg.cv.deep_scan.min_duration_coverage:
continue
normalized.append(replace(result, match_score=weighted_score))