diff --git a/server/handlers/vendors/vendorEmby/me.go b/server/handlers/vendors/vendorEmby/me.go index 86efc17..b2a3f4c 100644 --- a/server/handlers/vendors/vendorEmby/me.go +++ b/server/handlers/vendors/vendorEmby/me.go @@ -1,9 +1,11 @@ package vendorEmby import ( + "errors" "net/http" "github.com/gin-gonic/gin" + "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" @@ -17,6 +19,12 @@ func Me(ctx *gin.Context) { eucd, err := user.EmbyCache().Get(ctx) if err != nil { + if errors.Is(err, db.ErrNotFound("vendor")) { + ctx.JSON(http.StatusOK, model.NewApiDataResp(&EmbyMeResp{ + IsLogin: false, + })) + return + } ctx.AbortWithStatusJSON(http.StatusInternalServerError, model.NewApiErrorResp(err)) return } @@ -26,7 +34,7 @@ func Me(ctx *gin.Context) { Token: eucd.ApiKey, }) if err != nil { - ctx.AbortWithStatusJSON(http.StatusBadRequest, model.NewApiErrorResp(err)) + ctx.AbortWithStatusJSON(http.StatusInternalServerError, model.NewApiErrorResp(err)) return }