[1.1.3] - 2026-04-12
Fixed
- #27 Downloads marked completed when ffmpeg produces a truncated file: older SD-only BBC content (e.g. The Catherine Tate Show at 704x396) was being downloaded as audio-only (~27MB) and marked as completed. Two root causes addressed:
- FHD probe false positive on SD content:
ProbeHiddenFHDrewrote HLS variant URLs tovideo=12000000and HEAD-probed them. BBC's Unified Streaming Platform returns HTTP 200 for non-existent bitrates, generating a manifest with only the audio stream. Added a resolution guard: if the master playlist's max RESOLUTION height is below 720p, the HEAD probe is skipped and definitive absence is returned. - No post-download validation: after ffmpeg exits 0,
processDownloadnow stats the output file and compares it against the estimated size. If actual size is below 30% of expected, the download is failed with a newFailCodeTruncatederror code and the partial file is removed. This catches all truncation causes (FHD false positives, CDN throttling, network interruptions).
- FHD probe false positive on SD content:
Performance
- Quality probe skips FHD check for SD-only content:
probeOnenow checks the mediaselector heights before callingProbeHiddenFHD. If the best available height is below 720p, the FHD probe is skipped entirely, saving an HTTP round-trip per episode. - Show-level probe deduplication:
PrefetchPIDsnow groups items by ShowName and probes one representative PID per show. The result is reused for all siblings via cache writes, reducing BBC API calls from 3 per PID to 3 per show. A 200-episode show search drops from ~600 API calls to 3, cutting first-time search latency from ~120s to ~2-5s. Falls back to individual probing if the leader PID fails.
Tests
TestMaxPlaylistHeightunit test for the resolution guard helper.TestProbeHiddenFHD_SDOnlyPlaylist_ReturnsDefinitiveAbsenceverifies the HEAD probe is never called for SD-only master playlists.TestProbeHiddenFHD_720pPlaylist_StillProbesverifies 720p+ content still gets the FHD probe.TestFailDownloadRetryabilityextended with truncated-not-retryable case.TestPrefetch_ShowGroupDedup_ProbesOncePerShowverifies one probe per show, not per PID.TestPrefetch_ShowGroupDedup_CacheHitCoversGroupverifies zero HTTP calls when any sibling is cached.TestPrefetch_ShowGroupDedup_FirstFails_FallsBackToIndividualverifies fallback on leader failure.TestPrefetch_ShowGroupDedup_AllFail_ReturnsNilverifies nil result when every probe fails.- 227 Go tests pass across 8 packages.