add support for subsonic podcast api

This commit is contained in:
Alex McGrath
2021-02-03 20:38:01 +00:00
committed by Senan Kelly
parent ce96b9f6fa
commit 9c4286b0e2
21 changed files with 2011 additions and 1000 deletions

View File

@@ -41,6 +41,9 @@ func (c *Controller) ServeScrobble(r *http.Request) *spec.Response {
if err != nil {
return spec.NewError(10, "please provide an `id` parameter")
}
if id.Type == specid.Podcast || id.Type == specid.PodcastEpisode {
return spec.NewError(10, "please provide a valid track id")
}
// fetch user to get lastfm session
user := r.Context().Value(CtxUser).(*db.User)
// fetch track for getting info to send to last.fm function
@@ -107,6 +110,7 @@ func (c *Controller) ServeGetUser(r *http.Request) *spec.Response {
AdminRole: user.IsAdmin,
JukeboxRole: true,
ScrobblingEnabled: hasLastFM || hasListenBrainz,
PodcastRole: c.Podcasts.PodcastBasePath != "",
Folder: []int{1},
}
return sub