subsonic

package
v0.8.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Feb 15, 2020 License: GPL-3.0 Imports: 22 Imported by: 0

Documentation

Index

Constants

View Source
const Version = "1.8.0"

Variables

This section is empty.

Functions

func H

func H(r chi.Router, path string, f Handler)

Add the Subsonic handler, with and without `.view` extension Ex: if path = `ping` it will create the routes `/ping` and `/ping.view`

func HGone

func HGone(r chi.Router, path string)

Add a handler that returns 410 - Gone. Used to signal that an endpoint will not be implemented

func NewError

func NewError(code int, message ...interface{}) error

func NewResponse

func NewResponse() *responses.Subsonic

func RequiredParamInt

func RequiredParamInt(r *http.Request, param string, msg string) (int, error)

func RequiredParamString

func RequiredParamString(r *http.Request, param string, msg string) (string, error)

func RequiredParamStrings

func RequiredParamStrings(r *http.Request, param string, msg string) ([]string, error)

func SendError

func SendError(w http.ResponseWriter, r *http.Request, err error)

func SendResponse

func SendResponse(w http.ResponseWriter, r *http.Request, payload *responses.Subsonic)

func ToAlbum

func ToAlbum(entry engine.Entry) responses.Child

func ToAlbums

func ToAlbums(entries engine.Entries) []responses.Child

func ToArtists

func ToArtists(entries engine.Entries) []responses.Artist

func ToChild

func ToChild(entry engine.Entry) responses.Child

func ToChildren

func ToChildren(entries engine.Entries) []responses.Child

func ToGenres

func ToGenres(genres model.Genres) *responses.Genres

Types

type AlbumListController

type AlbumListController struct {
	// contains filtered or unexported fields
}

func NewAlbumListController

func NewAlbumListController(listGen engine.ListGenerator) *AlbumListController

func (*AlbumListController) GetAlbumList

func (*AlbumListController) GetAlbumList2

func (*AlbumListController) GetNowPlaying

func (*AlbumListController) GetRandomSongs

func (*AlbumListController) GetStarred

func (*AlbumListController) GetStarred2

type BrowsingController

type BrowsingController struct {
	// contains filtered or unexported fields
}

func NewBrowsingController

func NewBrowsingController(browser engine.Browser) *BrowsingController

func (*BrowsingController) GetAlbum

func (*BrowsingController) GetArtist

func (*BrowsingController) GetArtistInfo added in v0.7.3

TODO Integrate with Last.FM

func (*BrowsingController) GetArtistInfo2 added in v0.7.3

TODO Integrate with Last.FM

func (*BrowsingController) GetArtists

func (*BrowsingController) GetGenres

func (*BrowsingController) GetIndexes

func (*BrowsingController) GetMusicDirectory

func (c *BrowsingController) GetMusicDirectory(w http.ResponseWriter, r *http.Request) (*responses.Subsonic, error)

func (*BrowsingController) GetMusicFolders

func (c *BrowsingController) GetMusicFolders(w http.ResponseWriter, r *http.Request) (*responses.Subsonic, error)

func (*BrowsingController) GetSong

type Handler

type Handler = func(http.ResponseWriter, *http.Request) (*responses.Subsonic, error)

type MediaAnnotationController

type MediaAnnotationController struct {
	// contains filtered or unexported fields
}

func NewMediaAnnotationController

func NewMediaAnnotationController(scrobbler engine.Scrobbler, ratings engine.Ratings) *MediaAnnotationController

func (*MediaAnnotationController) Scrobble

func (*MediaAnnotationController) SetRating

func (*MediaAnnotationController) Star

func (*MediaAnnotationController) Unstar

type MediaRetrievalController

type MediaRetrievalController struct {
	// contains filtered or unexported fields
}

func NewMediaRetrievalController

func NewMediaRetrievalController(cover engine.Cover) *MediaRetrievalController

func (*MediaRetrievalController) GetAvatar

func (*MediaRetrievalController) GetCoverArt

type PlaylistsController

type PlaylistsController struct {
	// contains filtered or unexported fields
}

func NewPlaylistsController

func NewPlaylistsController(pls engine.Playlists) *PlaylistsController

func (*PlaylistsController) CreatePlaylist

func (*PlaylistsController) DeletePlaylist

func (*PlaylistsController) GetPlaylist

func (*PlaylistsController) GetPlaylists

func (*PlaylistsController) UpdatePlaylist

type Router

type Router struct {
	Browser       engine.Browser
	Cover         engine.Cover
	ListGenerator engine.ListGenerator
	Playlists     engine.Playlists
	Ratings       engine.Ratings
	Scrobbler     engine.Scrobbler
	Search        engine.Search
	Users         engine.Users
	Streamer      engine.MediaStreamer
	// contains filtered or unexported fields
}

func New

func New(browser engine.Browser, cover engine.Cover, listGenerator engine.ListGenerator, users engine.Users,
	playlists engine.Playlists, ratings engine.Ratings, scrobbler engine.Scrobbler, search engine.Search,
	streamer engine.MediaStreamer) *Router

func (*Router) ServeHTTP

func (api *Router) ServeHTTP(w http.ResponseWriter, r *http.Request)

type SearchingController

type SearchingController struct {
	// contains filtered or unexported fields
}

func NewSearchingController

func NewSearchingController(search engine.Search) *SearchingController

func (*SearchingController) Search2

func (*SearchingController) Search3

type StreamController

type StreamController struct {
	// contains filtered or unexported fields
}

func NewStreamController

func NewStreamController(streamer engine.MediaStreamer) *StreamController

func (*StreamController) Download

func (*StreamController) Stream

type SubsonicError

type SubsonicError struct {
	// contains filtered or unexported fields
}

func (SubsonicError) Error

func (e SubsonicError) Error() string

type SystemController

type SystemController struct{}

func NewSystemController

func NewSystemController() *SystemController

func (*SystemController) GetLicense

func (*SystemController) Ping

type UsersController

type UsersController struct{}

func NewUsersController

func NewUsersController() *UsersController

func (*UsersController) GetUser

TODO This is a placeholder. The real one has to read this info from a config file or the database

Directories

Path Synopsis

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL