Update list of Not Implemented / Gone Subsonic API endpoints
This commit is contained in:
+37
-13
@@ -154,12 +154,21 @@ func (api *Router) routes() http.Handler {
|
|||||||
h(withPlayer, "download", c.Download)
|
h(withPlayer, "download", c.Download)
|
||||||
})
|
})
|
||||||
|
|
||||||
// Deprecated/Out of scope endpoints
|
// Not Implemented (yet?)
|
||||||
h410(r, "getChatMessages")
|
h501(r, "getLyrics")
|
||||||
h410(r, "addChatMessage")
|
h501(r, "jukeboxControl")
|
||||||
h410(r, "getVideos")
|
h501(r, "getAlbumInfo", "getAlbumInfo2")
|
||||||
h410(r, "getVideoInfo")
|
h501(r, "getShares", "createShare", "updateShare", "deleteShare")
|
||||||
h410(r, "getCaptions")
|
h501(r, "getPodcasts", "getNewestPodcasts", "refreshPodcasts", "createPodcastChannel", "deletePodcastChannel",
|
||||||
|
"deletePodcastEpisode", "downloadPodcastEpisode")
|
||||||
|
h501(r, "getInternetRadioStations", "createInternetRadioStation", "updateInternetRadioStation",
|
||||||
|
"deleteInternetRadioStation")
|
||||||
|
h501(r, "createUser", "updateUser", "deleteUser", "changePassword")
|
||||||
|
|
||||||
|
// Deprecated/Won't implement/Out of scope endpoints
|
||||||
|
h410(r, "search")
|
||||||
|
h410(r, "getChatMessages", "addChatMessage")
|
||||||
|
h410(r, "getVideos", "getVideoInfo", "getCaptions", "hls")
|
||||||
return r
|
return r
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -188,14 +197,29 @@ func h(r chi.Router, path string, f handler) {
|
|||||||
r.HandleFunc("/"+path+".view", handle)
|
r.HandleFunc("/"+path+".view", handle)
|
||||||
}
|
}
|
||||||
|
|
||||||
// Add a handler that returns 410 - Gone. Used to signal that an endpoint will not be implemented
|
// Add a handler that returns 510 - Not implemented. Used to signal that an endpoint is not implemented yet
|
||||||
func h410(r chi.Router, path string) {
|
func h501(r *chi.Mux, paths ...string) {
|
||||||
handle := func(w http.ResponseWriter, r *http.Request) {
|
for _, path := range paths {
|
||||||
w.WriteHeader(410)
|
handle := func(w http.ResponseWriter, r *http.Request) {
|
||||||
_, _ = w.Write([]byte("This endpoint will not be implemented"))
|
w.Header().Add("Cache-Control", "no-cache")
|
||||||
|
w.WriteHeader(510)
|
||||||
|
_, _ = w.Write([]byte("This endpoint is not implemented, but may be in future releases"))
|
||||||
|
}
|
||||||
|
r.HandleFunc("/"+path, handle)
|
||||||
|
r.HandleFunc("/"+path+".view", handle)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
// Add a handler that returns 410 - Gone. Used to signal that an endpoint will not be implemented
|
||||||
|
func h410(r chi.Router, paths ...string) {
|
||||||
|
for _, path := range paths {
|
||||||
|
handle := func(w http.ResponseWriter, r *http.Request) {
|
||||||
|
w.WriteHeader(410)
|
||||||
|
_, _ = w.Write([]byte("This endpoint will not be implemented"))
|
||||||
|
}
|
||||||
|
r.HandleFunc("/"+path, handle)
|
||||||
|
r.HandleFunc("/"+path+".view", handle)
|
||||||
}
|
}
|
||||||
r.HandleFunc("/"+path, handle)
|
|
||||||
r.HandleFunc("/"+path+".view", handle)
|
|
||||||
}
|
}
|
||||||
|
|
||||||
func sendError(w http.ResponseWriter, r *http.Request, err error) {
|
func sendError(w http.ResponseWriter, r *http.Request, err error) {
|
||||||
|
|||||||
Reference in New Issue
Block a user