Fix: emby not login err

pull/48/head
zijiren233 2 years ago
parent 78fd4e0ff1
commit 175333acbd

@ -7,6 +7,7 @@ import (
"github.com/gin-gonic/gin"
json "github.com/json-iterator/go"
"github.com/synctv-org/synctv/internal/db"
"github.com/synctv-org/synctv/internal/op"
"github.com/synctv-org/synctv/internal/vendor"
"github.com/synctv-org/synctv/server/model"
@ -55,6 +56,10 @@ func List(ctx *gin.Context) {
aucd, err := user.EmbyCache().Get(ctx)
if err != nil {
if errors.Is(err, db.ErrNotFound("vendor")) {
ctx.JSON(http.StatusBadRequest, model.NewApiErrorStringResp("emby not login"))
return
}
ctx.AbortWithStatusJSON(http.StatusInternalServerError, model.NewApiErrorResp(err))
return
}

Loading…
Cancel
Save