|
|
|
@ -67,14 +67,14 @@ func List(ctx *gin.Context) {
|
|
|
|
|
return
|
|
|
|
|
}
|
|
|
|
|
if total == 0 {
|
|
|
|
|
ctx.JSON(http.StatusBadRequest, model.NewApiErrorStringResp("emby server id not found"))
|
|
|
|
|
ctx.JSON(http.StatusBadRequest, model.NewApiErrorStringResp("emby server not found"))
|
|
|
|
|
return
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
ev, err := db.GetEmbyVendors(user.ID, append(socpes, db.Paginate(page, size))...)
|
|
|
|
|
if err != nil {
|
|
|
|
|
if errors.Is(err, db.ErrNotFound("vendor")) {
|
|
|
|
|
ctx.JSON(http.StatusBadRequest, model.NewApiErrorStringResp("emby server id not found"))
|
|
|
|
|
ctx.JSON(http.StatusBadRequest, model.NewApiErrorStringResp("emby server not found"))
|
|
|
|
|
return
|
|
|
|
|
}
|
|
|
|
|
ctx.AbortWithStatusJSON(http.StatusInternalServerError, model.NewApiErrorResp(err))
|
|
|
|
@ -124,7 +124,7 @@ EmbyFSListResp:
|
|
|
|
|
aucd, err := user.EmbyCache().LoadOrStore(ctx, serverID)
|
|
|
|
|
if err != nil {
|
|
|
|
|
if errors.Is(err, db.ErrNotFound("vendor")) {
|
|
|
|
|
ctx.JSON(http.StatusBadRequest, model.NewApiErrorStringResp("emby server id not found"))
|
|
|
|
|
ctx.JSON(http.StatusBadRequest, model.NewApiErrorStringResp("emby server not found"))
|
|
|
|
|
return
|
|
|
|
|
}
|
|
|
|
|
ctx.AbortWithStatusJSON(http.StatusInternalServerError, model.NewApiErrorResp(err))
|
|
|
|
|