Esempio n. 1
0
//
// get-queue-contents
//
func handle_GetQueueContents(s *sonos.Sonos, w http.ResponseWriter, r *http.Request) error {
	if queue, err := s.GetQueueContents(); nil != err {
		return err
	} else {
		replyOk(w, model.GetQueueContentsMessage(queue))
	}
	return nil
}
Esempio n. 2
0
//
// get-genre-artists
//
func handle_GetGenreArtists(s *sonos.Sonos, w http.ResponseWriter, r *http.Request) error {
	if artists, err := s.GetGenreArtists(r.FormValue("genre")); nil != err {
		return err
	} else {
		replyOk(w, model.GetQueueContentsMessage(artists))
	}
	return nil
}
Esempio n. 3
0
//
// get-artist-albums
//
func handle_GetArtistAlbums(s *sonos.Sonos, w http.ResponseWriter, r *http.Request) error {
	if list, err := s.GetArtistAlbums(r.FormValue("artist")); nil != err {
		return err
	} else {
		replyOk(w, model.GetQueueContentsMessage(list))
	}
	return nil
}
Esempio n. 4
0
//
// get-direct-children
//
func handle_GetDirectChildren(s *sonos.Sonos, w http.ResponseWriter, r *http.Request) error {
	if list, err := s.GetDirectChildren(r.FormValue("root")); nil != err {
		return err
	} else {
		replyOk(w, model.GetQueueContentsMessage(list))
	}
	return nil
}
Esempio n. 5
0
//
// get-album-tracks
//
func handle_GetAlbumTracks(s *sonos.Sonos, w http.ResponseWriter, r *http.Request) error {
	if tracks, err := s.GetAlbumTracks(r.FormValue("album")); nil != err {
		return err
	} else {
		replyOk(w, model.GetQueueContentsMessage(tracks))
	}
	return nil
}