diff --git a/internal/database/categories.go b/internal/database/categories.go index f2c0de4f..02b2cf29 100644 --- a/internal/database/categories.go +++ b/internal/database/categories.go @@ -9,7 +9,7 @@ import ( type Category struct { ID string `db:"id" json:"id"` Name string `db:"category_name" json:"name"` - BoxartURL string `json:"boxart_url"` + BoxartURL string `json:"box_art_url"` ViewerCount int `db:"vc" json:"-"` } diff --git a/internal/database/user.go b/internal/database/user.go index b372137d..1118d48e 100644 --- a/internal/database/user.go +++ b/internal/database/user.go @@ -72,6 +72,8 @@ type SearchChannel struct { TagIDs []string `json:"tag_ids" dbi:"false"` IsLive bool `json:"is_live" db:"is_live"` StartedAt *string `db:"started_at" json:"started_at"` + // calculated fields + ThumbNailURL string `json:"thumbnail_url"` } func (q *Query) GetUser(u User) (User, error) { @@ -327,6 +329,7 @@ func (q *Query) SearchChannels(query string, live_only bool) (*DBResponse, error r[i].StartedAt = &emptyString } r[i].TagIDs = st + r[i].ThumbNailURL = "https://static-cdn.jtvnw.net/jtv_user_pictures/3f13ab61-ec78-4fe6-8481-8682cb3b0ac2-channel_offline_image-300x300.png" } dbr := DBResponse{ diff --git a/internal/mock_api/endpoints/channels/information.go b/internal/mock_api/endpoints/channels/information.go index 1b5346d2..69e0b6c6 100644 --- a/internal/mock_api/endpoints/channels/information.go +++ b/internal/mock_api/endpoints/channels/information.go @@ -22,7 +22,7 @@ type Channel struct { CategoryID string `db:"category_id" json:"game_id"` CategoryName string `db:"category_name" json:"game_name" dbi:"false"` Title string `db:"title" json:"title"` - Language string `db:"stream_language" json:"stream_language"` + Language string `db:"stream_language" json:"broadcaster_language"` Delay int `dbi:"false" json:"delay"` }