Compare commits

...

2 commits

Author SHA1 Message Date
af3a348d99
Pass cursor into function
All checks were successful
ci/woodpecker/push/<no value> Pipeline was successful
ci/woodpecker/tag/<no value> Pipeline was successful
2023-07-29 21:04:52 -04:00
ed138fbe3e
Fix cursor 2023-07-29 20:57:23 -04:00
2 changed files with 5 additions and 3 deletions

View file

@ -111,7 +111,7 @@ func ParseCategory(data gjson.Result) (structs.CategoryPreview, error) {
Viewers: int(data.Get("node.viewersCount").Int()),
CreatedAt: data.Get("node.originalReleaseDate").Time(),
Tags: parsedTags,
Cursor: data.Get("node.cursor").String(),
Cursor: data.Get("cursor").String(),
Image: extractor.ProxyUrl(data.Get("node.avatarURL").String()),
}, nil
}

View file

@ -11,7 +11,8 @@ func Routes(route *gin.Engine) {
auth := route.Group("/api/discover")
auth.GET("", func(context *gin.Context) {
data, err := twitch.GetDiscoveryPage(50, "")
cursor := context.Query("cursor")
data, err := twitch.GetDiscoveryPage(50, cursor)
if err != nil {
context.Error(err)
return
@ -21,7 +22,8 @@ func Routes(route *gin.Engine) {
})
auth.GET("/:categoryName", func(context *gin.Context) {
data, err := twitch.GetDiscoveryItem(context.Param("categoryName"), 50, "")
cursor := context.Query("cursor")
data, err := twitch.GetDiscoveryItem(context.Param("categoryName"), 50, cursor)
if err != nil {
context.Error(err)
return