Skip to content

Commit

Permalink
Sign playlist urls
Browse files Browse the repository at this point in the history
  • Loading branch information
MatthiasReumann committed Aug 10, 2023
1 parent 7329f9b commit 91fa34b
Showing 1 changed file with 11 additions and 0 deletions.
11 changes: 11 additions & 0 deletions api/courses.go
Original file line number Diff line number Diff line change
Expand Up @@ -357,6 +357,17 @@ func (r coursesRoutes) getCourseBySlug(c *gin.Context) {
streams := course.Streams
streamsDTO := make([]model.StreamDTO, len(streams))
for i, s := range streams {
err := tools.SetSignedPlaylists(&s, &model.User{
Model: gorm.Model{ID: query.UserID},
}, course.DownloadsEnabled)
if err != nil {
_ = c.Error(tools.RequestError{
Err: err,
Status: http.StatusInternalServerError,
CustomMessage: "can't sign stream",
})
return
}
streamsDTO[i] = s.ToDTO()
}

Expand Down

0 comments on commit 91fa34b

Please sign in to comment.