cmd/streamdata: retry metadata entry

This enables fixing metadata when a mistake is made.

Signed-off-by: Yonah <contrib@gensokyo.uk>
This commit is contained in:
2026-03-19 17:38:30 +09:00
parent ccc496f55f
commit 70476f2c51

View File

@@ -130,11 +130,12 @@ func main() {
defer toErr(&err) defer toErr(&err)
isattyStd() isattyStd()
br := bufio.NewReader(os.Stdin) br := bufio.NewReader(os.Stdin)
now := time.Now()
retry:
v.Title = require(promptTrimNoEmpty(br, "Title: ")) v.Title = require(promptTrimNoEmpty(br, "Title: "))
v.Category = require(prompt(br, "Category: ")) v.Category = require(prompt(br, "Category: "))
now := time.Now()
year := require(promptUintFallbackBounds( year := require(promptUintFallbackBounds(
br, "Year: ", br, "Year: ",
1970, uint64(now.Year()), 1970, uint64(now.Year()),
@@ -161,6 +162,11 @@ func main() {
time.UTC, time.UTC,
) )
printVOD(v)
if !require(promptBool(br, "Proceed? ", true)) {
goto retry
}
var resp *http.Response var resp *http.Response
if resp, err = http.DefaultClient.Do(req); err != nil { if resp, err = http.DefaultClient.Do(req); err != nil {
return return