cmd/streamdata: check against overwriting

This prevents inadvertently queuing an existing vod, only to fail the check after copy completes.

Signed-off-by: Yonah <contrib@gensokyo.uk>
This commit is contained in:
2026-03-19 01:09:31 +09:00
parent 49931c6e75
commit d219c27528

View File

@@ -112,6 +112,16 @@ func main() {
return err
}
var e *streamdata.VOD
if e, err = channel.Load(&ident); err != nil {
if !errors.Is(err, os.ErrNotExist) {
return err
}
} else {
printVOD(e)
return errors.New("attempting to overwrite existing vod")
}
return channel.Add(&ident, func(
v *streamdata.VOD,
w io.Writer,