Skip to content

Commit

Permalink
Merge pull request #165 from xhyqaq/fix/video-list
Browse files Browse the repository at this point in the history
fix: video-list
  • Loading branch information
IRONICBo committed Feb 21, 2024
2 parents 8bcaa1d + 6f16dad commit f192b4d
Show file tree
Hide file tree
Showing 3 changed files with 693 additions and 8 deletions.
16 changes: 14 additions & 2 deletions cmd/gopcomm/community_yap.gox
Original file line number Diff line number Diff line change
Expand Up @@ -203,15 +203,27 @@ get "/delete", ctx => {
get "/medias", ctx => {
format := ctx.param("format")
uid := ctx.param("uid")
files, err := community.ListMediaByUserId(todo, uid, format)
from := ctx.param("from")
fromInt, err := strconv.Atoi(from)
if err != nil {
fromInt = 0
}
limit := ctx.param("limit")
limitInt, err := strconv.Atoi(limit)
if err != nil {
limitInt = limitConst
}
files,next,err := community.ListMediaByUserId(todo, uid, format,fromInt,limitInt)
if err != nil {
ctx.json {
"code": 0,
"err": "get media failed",
"next": next,
"err": err.Error(),
}
} else {
ctx.json {
"code": 200,
"next": next,
"items": files,
}
}
Expand Down
Loading

0 comments on commit f192b4d

Please sign in to comment.