some tweaks in getting episodes

This commit is contained in:
2024-11-06 22:35:15 +01:00
parent 3d71a16633
commit 90c21a1f55
6 changed files with 31 additions and 4 deletions
+1
View File
@@ -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",
})
+8 -3
View File
@@ -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,
})
}