Polishing

This commit is contained in:
Deluan 2016-03-24 14:44:21 -04:00
parent 770a16ece3
commit 3c8f6e9a65
4 changed files with 16 additions and 17 deletions

View file

@ -20,7 +20,7 @@ func (c *BrowsingController) Prepare() {
utils.ResolveDependencies(&c.browser)
}
func (c *BrowsingController) GetMediaFolders() {
func (c *BrowsingController) GetMusicFolders() {
mediaFolderList, _ := c.browser.MediaFolders()
folders := make([]responses.MusicFolder, len(mediaFolderList))
for i, f := range mediaFolderList {
@ -32,7 +32,6 @@ func (c *BrowsingController) GetMediaFolders() {
c.SendResponse(response)
}
// TODO: Shortcuts amd validate musicFolder parameter
func (c *BrowsingController) GetIndexes() {
ifModifiedSince := c.ParamTime("ifModifiedSince", time.Time{})
@ -62,7 +61,7 @@ func (c *BrowsingController) GetIndexes() {
c.SendResponse(response)
}
func (c *BrowsingController) GetDirectory() {
func (c *BrowsingController) GetMusicDirectory() {
id := c.RequiredParamString("id", "id parameter required")
response := c.NewEmpty()

View file

@ -31,7 +31,7 @@ func (c *MediaRetrievalController) GetAvatar() {
io.Copy(c.Ctx.ResponseWriter, f)
}
func (c *MediaRetrievalController) GetCover() {
func (c *MediaRetrievalController) GetCoverArt() {
id := c.RequiredParamString("id", "id parameter required")
size := c.ParamInt("size", 0)

View file

@ -19,7 +19,7 @@ func (c *PlaylistsController) Prepare() {
utils.ResolveDependencies(&c.pls)
}
func (c *PlaylistsController) GetAll() {
func (c *PlaylistsController) GetPlaylists() {
allPls, err := c.pls.GetAll()
if err != nil {
beego.Error(err)
@ -40,7 +40,7 @@ func (c *PlaylistsController) GetAll() {
c.SendResponse(response)
}
func (c *PlaylistsController) Get() {
func (c *PlaylistsController) GetPlaylist() {
id := c.RequiredParamString("id", "id parameter required")
pinfo, err := c.pls.Get(id)
@ -58,7 +58,7 @@ func (c *PlaylistsController) Get() {
c.SendResponse(response)
}
func (c *PlaylistsController) Create() {
func (c *PlaylistsController) CreatePlaylist() {
songIds := c.RequiredParamStrings("songId", "Required parameter songId is missing")
name := c.RequiredParamString("name", "Required parameter name is missing")
err := c.pls.Create(name, songIds)
@ -69,7 +69,7 @@ func (c *PlaylistsController) Create() {
c.SendEmptyResponse()
}
func (c *PlaylistsController) Delete() {
func (c *PlaylistsController) DeletePlaylist() {
id := c.RequiredParamString("id", "Required parameter id is missing")
err := c.pls.Delete(id)
if err != nil {
@ -79,7 +79,7 @@ func (c *PlaylistsController) Delete() {
c.SendEmptyResponse()
}
func (c *PlaylistsController) Update() {
func (c *PlaylistsController) UpdatePlaylist() {
playlistId := c.RequiredParamString("playlistId", "Required parameter playlistId is missing")
songsToAdd := c.ParamStrings("songIdToAdd")
songIndexesToRemove := c.ParamInts("songIndexToRemove")

View file

@ -19,13 +19,13 @@ func mapEndpoints() {
beego.NSRouter("/ping.view", &api.SystemController{}, "*:Ping"),
beego.NSRouter("/getLicense.view", &api.SystemController{}, "*:GetLicense"),
beego.NSRouter("/getMusicFolders.view", &api.BrowsingController{}, "*:GetMediaFolders"),
beego.NSRouter("/getMusicFolders.view", &api.BrowsingController{}, "*:GetMusicFolders"),
beego.NSRouter("/getIndexes.view", &api.BrowsingController{}, "*:GetIndexes"),
beego.NSRouter("/getMusicDirectory.view", &api.BrowsingController{}, "*:GetDirectory"),
beego.NSRouter("/getMusicDirectory.view", &api.BrowsingController{}, "*:GetMusicDirectory"),
beego.NSRouter("/search2.view", &api.SearchingController{}, "*:Search2"),
beego.NSRouter("/getCoverArt.view", &api.MediaRetrievalController{}, "*:GetCover"),
beego.NSRouter("/getCoverArt.view", &api.MediaRetrievalController{}, "*:GetCoverArt"),
beego.NSRouter("/getAvatar.view", &api.MediaRetrievalController{}, "*:GetAvatar"),
beego.NSRouter("/stream.view", &api.StreamController{}, "*:Stream"),
beego.NSRouter("/download.view", &api.StreamController{}, "*:Download"),
@ -39,11 +39,11 @@ func mapEndpoints() {
beego.NSRouter("/getStarred.view", &api.AlbumListController{}, "*:GetStarred"),
beego.NSRouter("/getNowPlaying.view", &api.AlbumListController{}, "*:GetNowPlaying"),
beego.NSRouter("/getPlaylists.view", &api.PlaylistsController{}, "*:GetAll"),
beego.NSRouter("/getPlaylist.view", &api.PlaylistsController{}, "*:Get"),
beego.NSRouter("/createPlaylist.view", &api.PlaylistsController{}, "*:Create"),
beego.NSRouter("/updatePlaylist.view", &api.PlaylistsController{}, "*:Update"),
beego.NSRouter("/deletePlaylist.view", &api.PlaylistsController{}, "*:Delete"),
beego.NSRouter("/getPlaylists.view", &api.PlaylistsController{}, "*:GetPlaylists"),
beego.NSRouter("/getPlaylist.view", &api.PlaylistsController{}, "*:GetPlaylist"),
beego.NSRouter("/createPlaylist.view", &api.PlaylistsController{}, "*:CreatePlaylist"),
beego.NSRouter("/updatePlaylist.view", &api.PlaylistsController{}, "*:UpdatePlaylist"),
beego.NSRouter("/deletePlaylist.view", &api.PlaylistsController{}, "*:DeletePlaylist"),
beego.NSRouter("/getUser.view", &api.UsersController{}, "*:GetUser"),
)