some tweaks in getting episodes
This commit is contained in:
@@ -66,6 +66,7 @@ func (hq *Handlers) ToBeImplemented(c *gin.Context) {
|
||||
}
|
||||
|
||||
func (hq *Handlers) Ping(c *gin.Context) {
|
||||
slog.Info("ping", RequestID, c.Request.Context().Value(RequestID))
|
||||
c.JSON(http.StatusOK, gin.H{
|
||||
"message": "pong",
|
||||
})
|
||||
|
||||
@@ -50,9 +50,14 @@ func (hq *Handlers) GetTVShow(c *gin.Context) {
|
||||
slog.Info("tv show exists", "ttid", ttShowID, "title", tvShow.Name)
|
||||
}
|
||||
|
||||
tvShowMedian, _ := hq.Queries.TvShowMedianRating(c, sqlcEpisodes[0].TvShowID)
|
||||
tvShowAverage, _ := hq.Queries.TvShowAverageRating(c, sqlcEpisodes[0].TvShowID)
|
||||
|
||||
c.JSON(http.StatusOK, gin.H{
|
||||
"popularity": tvShow.Popularity,
|
||||
"title": title,
|
||||
"seasons": sqlcEpisodes,
|
||||
"popularity": tvShow.Popularity,
|
||||
"title": title,
|
||||
"seasons": sqlcEpisodes,
|
||||
"tvShowMedian": tvShowMedian,
|
||||
"tvShowAverage": tvShowAverage,
|
||||
})
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user