refactor podcast schema and generate unique episode paths (#373)

closes #350
This commit is contained in:
Senan Kelly
2023-09-21 00:01:16 +01:00
committed by GitHub
parent c13d17262f
commit 33f1f2e0cf
15 changed files with 401 additions and 193 deletions

View File

@@ -184,11 +184,7 @@ func (c *Controller) ServeGetPlayQueue(r *http.Request) *spec.Response {
c.DB.
Where("id=?", id.Value).
Find(&pe)
p := db.Podcast{}
c.DB.
Where("id=?", pe.PodcastID).
Find(&p)
sub.PlayQueue.List[i] = spec.NewTCPodcastEpisode(&pe, &p)
sub.PlayQueue.List[i] = spec.NewTCPodcastEpisode(&pe)
sub.PlayQueue.List[i].TranscodeMeta = transcodeMeta
}
}
@@ -300,7 +296,7 @@ func (c *Controller) ServeJukebox(r *http.Request) *spec.Response { // nolint:go
trackPaths := func(ids []specid.ID) ([]string, error) {
var paths []string
for _, id := range ids {
r, err := specidpaths.Locate(c.DB, c.PodcastsPath, id)
r, err := specidpaths.Locate(c.DB, id)
if err != nil {
return nil, fmt.Errorf("find track by id: %w", err)
}