mirror of
https://github.com/photoprism/photoprism.git
synced 2025-12-12 00:34:13 +01:00
API: Apply "golangci-lint" recommendations #5330
Signed-off-by: Michael Mayer <michael@photoprism.app>
This commit is contained in:
@@ -55,15 +55,16 @@ func PostVisionCaption(router *gin.RouterGroup) {
|
||||
// Run inference to generate a caption.
|
||||
result, model, err := vision.GenerateCaption(request.Images, media.SrcRemote)
|
||||
|
||||
if err != nil {
|
||||
switch {
|
||||
case err != nil:
|
||||
log.Errorf("vision: %s (caption)", err)
|
||||
c.JSON(http.StatusBadRequest, vision.NewApiError(request.GetId(), http.StatusBadRequest))
|
||||
return
|
||||
} else if model == nil {
|
||||
case model == nil:
|
||||
log.Errorf("vision: no model specified (caption)")
|
||||
c.JSON(http.StatusInternalServerError, vision.NewApiError(request.GetId(), http.StatusInternalServerError))
|
||||
return
|
||||
} else if result == nil {
|
||||
case result == nil:
|
||||
log.Errorf("vision: no result (caption)")
|
||||
c.JSON(http.StatusInternalServerError, vision.NewApiError(request.GetId(), http.StatusInternalServerError))
|
||||
return
|
||||
|
||||
Reference in New Issue
Block a user