0
Fork 0
mirror of https://codeberg.org/SafeTwitch/safetwitch-backend.git synced 2024-12-22 05:02:58 -05:00

Fix integration errors

This commit is contained in:
dragongoose 2023-05-29 16:02:10 -04:00
parent 0628d99be2
commit 15e4de67ee
No known key found for this signature in database
GPG key ID: 50DB99B921579009
3 changed files with 8 additions and 8 deletions

View file

@ -13,9 +13,9 @@ func ParseSocials(data string) ([]structs.Social, error) {
result := gjson.Get(data, "user.channel.socialMedias")
for _, social := range result.Array() {
parsedSocials = append(parsedSocials, structs.Social{
Title: social.Get("title").String(),
Type: social.Get("name").String(),
Url: social.Get("url").String(),
Name: social.Get("title").String(),
Type: social.Get("name").String(),
Url: social.Get("url").String(),
})
}
@ -95,7 +95,7 @@ func ParseMinifiedStream(data gjson.Result) (structs.CategoryMinifiedStream, err
parsedStream := structs.CategoryMinifiedStream{
Title: data.Get("node.title").String(),
Viewers: int(data.Get("node.viewersCount").Int()),
Preview: ProxyUrl(data.Get("previewImageURL").String()),
Preview: ProxyUrl(data.Get("node.previewImageURL").String()),
Tags: tags,
Streamer: structs.CategoryMinifiedStreamer{
Name: data.Get("node.broadcaster.login").String(),

View file

@ -3,9 +3,9 @@ package structs
import "time"
type Social struct {
Type string `json:"type"`
Title string `json:"title"`
Url string `json:"url"`
Type string `json:"type"`
Name string `json:"name"`
Url string `json:"url"`
}
type Stream struct {

View file

@ -14,7 +14,7 @@ func ProxyUrl(url string) string {
type ServerFormat struct {
Status string `json:"status"`
Message interface{} `json:"message"`
Message interface{} `json:"data"`
}
func FormatMessage(data interface{}, ok bool) ServerFormat {