mirror of
https://github.com/navidrome/navidrome.git
synced 2025-04-04 13:07:36 +03:00
Add getShares
and createShare
Subsonic endpoints
This commit is contained in:
parent
94cc2b2ac5
commit
d0dceae094
21 changed files with 257 additions and 56 deletions
|
@ -38,11 +38,12 @@ type Router struct {
|
|||
scanner scanner.Scanner
|
||||
broker events.Broker
|
||||
scrobbler scrobbler.PlayTracker
|
||||
share core.Share
|
||||
}
|
||||
|
||||
func New(ds model.DataStore, artwork artwork.Artwork, streamer core.MediaStreamer, archiver core.Archiver,
|
||||
players core.Players, externalMetadata core.ExternalMetadata, scanner scanner.Scanner, broker events.Broker,
|
||||
playlists core.Playlists, scrobbler scrobbler.PlayTracker) *Router {
|
||||
playlists core.Playlists, scrobbler scrobbler.PlayTracker, share core.Share) *Router {
|
||||
r := &Router{
|
||||
ds: ds,
|
||||
artwork: artwork,
|
||||
|
@ -54,6 +55,7 @@ func New(ds model.DataStore, artwork artwork.Artwork, streamer core.MediaStreame
|
|||
scanner: scanner,
|
||||
broker: broker,
|
||||
scrobbler: scrobbler,
|
||||
share: share,
|
||||
}
|
||||
r.Handler = r.routes()
|
||||
return r
|
||||
|
@ -124,6 +126,10 @@ func (api *Router) routes() http.Handler {
|
|||
h(r, "getPlayQueue", api.GetPlayQueue)
|
||||
h(r, "savePlayQueue", api.SavePlayQueue)
|
||||
})
|
||||
r.Group(func(r chi.Router) {
|
||||
h(r, "getShares", api.GetShares)
|
||||
h(r, "createShare", api.CreateShare)
|
||||
})
|
||||
r.Group(func(r chi.Router) {
|
||||
r.Use(getPlayer(api.players))
|
||||
h(r, "search2", api.Search2)
|
||||
|
@ -164,7 +170,7 @@ func (api *Router) routes() http.Handler {
|
|||
|
||||
// Not Implemented (yet?)
|
||||
h501(r, "jukeboxControl")
|
||||
h501(r, "getShares", "createShare", "updateShare", "deleteShare")
|
||||
h501(r, "updateShare", "deleteShare")
|
||||
h501(r, "getPodcasts", "getNewestPodcasts", "refreshPodcasts", "createPodcastChannel", "deletePodcastChannel",
|
||||
"deletePodcastEpisode", "downloadPodcastEpisode")
|
||||
h501(r, "createUser", "updateUser", "deleteUser", "changePassword")
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue