Documentation
¶
Overview ¶
Package mediacheck rejects video files that hold no data.
An incomplete download can leave a file with the right name and size whose bytes are all zero: the client preallocated it and never wrote the pieces. Recorded as an episode file, it marks the episode as "have file" forever, so nothing re-downloads it. Import and the library scan call Check before recording a file.
Index ¶
Constants ¶
This section is empty.
Variables ¶
var ErrNoData = errors.New("file contains no data (empty, or all zeros: an incomplete download?)")
ErrNoData is returned for a file that is empty or whose sampled bytes are all zero.
Functions ¶
func Check ¶
Check reads a few small chunks spread across path and returns ErrNoData when every one of them is zero (or the file is empty). Any real video container has non-zero bytes in its header, so a healthy file passes on the first read. A partially downloaded file with some pieces written passes too: Check only catches files with no data at all.
Types ¶
This section is empty.