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:
@@ -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
|
||||||
|
|||||||
Reference in New Issue
Block a user