From f86d02187b6bb9536a6af9ceadde2e7e6f9bff5d Mon Sep 17 00:00:00 2001 From: Andinus Date: Wed, 25 Mar 2020 02:54:37 +0530 Subject: Disable random flag on bpod & warn in readme --- cmd/cetus/bpod.go | 20 +++++++++++++++++--- 1 file changed, 17 insertions(+), 3 deletions(-) (limited to 'cmd') diff --git a/cmd/cetus/bpod.go b/cmd/cetus/bpod.go index d16dc22..9e92edb 100644 --- a/cmd/cetus/bpod.go +++ b/cmd/cetus/bpod.go @@ -24,6 +24,13 @@ func execBPOD() { reqInfo = make(map[string]string) reqInfo["api"] = bpodApi + // Disable random flag on bpod. + if random { + log.Println("Random flag on BPOD has been disabled due to a bug") + log.Println("https://github.com/andinus/cetus/issues/1") + random = false + } + if random { reqInfo["random"] = "true" } @@ -108,9 +115,16 @@ func execBPOD() { // bug in the program. Random flag was passed so 7 images will // be retrieved & 7 will get saved in this json file. This // will cause error when `cetus set bpod -random` is run for - // the first time on specific date & then `cetus set bpod` is - // run, the second command will set random background because - // the first one has downloaded all 7 in the json file. + // the first time on specific date and the same date gets + // selected randomly & then `cetus set bpod` is run, the + // second command will set random background because the first + // one has downloaded all 7 in the json file. + // + // Solution: Marshal json again but keeping only the selected + // date information. This is not a perfect solution, if you + // have a better solution then please let me know. For time + // being I have to disable random flag in bpod because of this + // bug. if random { // Write body to the cache so that it can be read // later. -- cgit 1.4.1-2-gfad0