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:
parent
0628d99be2
commit
15e4de67ee
3 changed files with 8 additions and 8 deletions
|
@ -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(),
|
||||
|
|
|
@ -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 {
|
||||
|
|
|
@ -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 {
|
||||
|
|
Loading…
Reference in a new issue