diff options
| author | lost+skunk <[email protected]> | 2024-09-04 20:22:58 +0300 |
|---|---|---|
| committer | lost+skunk <[email protected]> | 2024-09-04 20:22:58 +0300 |
| commit | c39399403e031a8c1ad53969770e4261d2c9e7aa (patch) | |
| tree | ecac0ca1c9f095803abec42962d5aa31107676f1 /app/api.go | |
| parent | 5a8a0987a2db22de6b9dd184bf40a3e2d16c5bbf (diff) | |
| download | skunky-art-c39399403e031a8c1ad53969770e4261d2c9e7aa.tar.gz skunky-art-c39399403e031a8c1ad53969770e4261d2c9e7aa.tar.bz2 skunky-art-c39399403e031a8c1ad53969770e4261d2c9e7aa.zip | |
отображение ошибок
Diffstat (limited to 'app/api.go')
| -rw-r--r-- | app/api.go | 6 |
1 files changed, 5 insertions, 1 deletions
@@ -58,8 +58,12 @@ func (a API) Random() { a.Error("Sorry, butt NSFW on this are disabled, and the instance failed to find a random art without NSFW", 500) } - s, err := devianter.PerformSearch(string(rand.Intn(999)), rand.Intn(30), 'a') + s, err, daErr := devianter.PerformSearch(string(rand.Intn(999)), rand.Intn(30), 'a') try(err) + if daErr.RAW != nil { + continue + } + deviation := &s.Results[rand.Intn(len(s.Results))] if deviation.NSFW && !CFG.Nsfw { |
