Skip to content

🎧 Your Personal Streaming Service

git fmt

Deluancd0fa5739b49
diff --git a/api/get_cover_art.go b/api/get_cover_art.go
index 590cb380b..9667aca7b 100644
--- a/api/get_cover_art.go
+++ b/api/get_cover_art.go
@@ -1,13 +1,13 @@
package api
import (
- "github.com/deluan/gosonic/domain"
- "github.com/karlkfi/inject"
- "github.com/deluan/gosonic/utils"
"github.com/astaxie/beego"
"github.com/deluan/gosonic/api/responses"
+ "github.com/deluan/gosonic/domain"
+ "github.com/deluan/gosonic/utils"
+ "github.com/dhowden/tag"
+ "github.com/karlkfi/inject"
"io/ioutil"
-"github.com/dhowden/tag"
"os"
)
@@ -34,7 +34,7 @@ func (c *GetCoverArtController) Get() {
var img []byte
- if (mf.HasCoverArt) {
+ if mf.HasCoverArt {
img, err = readFromTag(mf.Path)
beego.Debug("Serving cover art from", mf.Path)
} else {
@@ -47,7 +47,6 @@ func (c *GetCoverArtController) Get() {
c.SendError(responses.ERROR_DATA_NOT_FOUND, "cover art not available")
}
-
c.Ctx.Output.ContentType("image/jpg")
c.Ctx.Output.Body(img)
}
@@ -68,4 +67,3 @@ func readFromTag(path string) ([]byte, error) {
return m.Picture().Data, nil
}
-
diff --git a/api/get_music_directory.go b/api/get_music_directory.go
index 9ef226c43..9643d068b 100644
--- a/api/get_music_directory.go
+++ b/api/get_music_directory.go
@@ -45,7 +45,7 @@ func (c *GetMusicDirectoryController) Get() {
c.SendResponse(response)
}
-func (c *GetMusicDirectoryController) buildArtistDir(a *domain.Artist, albums []domain.Album) (*responses.Directory) {
+func (c *GetMusicDirectoryController) buildArtistDir(a *domain.Artist, albums []domain.Album) *responses.Directory {
dir := &responses.Directory{Id: a.Id, Name: a.Name}
dir.Child = make([]responses.Child, len(albums))
@@ -62,7 +62,7 @@ func (c *GetMusicDirectoryController) buildArtistDir(a *domain.Artist, albums []
return dir
}
-func (c *GetMusicDirectoryController) buildAlbumDir(al *domain.Album, tracks []domain.MediaFile) (*responses.Directory) {
+func (c *GetMusicDirectoryController) buildAlbumDir(al *domain.Album, tracks []domain.MediaFile) *responses.Directory {
dir := &responses.Directory{Id: al.Id, Name: al.Name}
dir.Child = make([]responses.Child, len(tracks))
@@ -87,7 +87,7 @@ func (c *GetMusicDirectoryController) buildAlbumDir(al *domain.Album, tracks []d
}
func (c *GetMusicDirectoryController) isArtist(id string) bool {
- found, err := c.artistRepo.Exists(id);
+ found, err := c.artistRepo.Exists(id)
if err != nil {
beego.Error("Error searching for Artist:", err)
c.SendError(responses.ERROR_GENERIC, "Internal Error")
@@ -105,7 +105,7 @@ func (c *GetMusicDirectoryController) isAlbum(id string) bool {
}
func (c *GetMusicDirectoryController) retrieveArtist(id string) (a *domain.Artist, as []domain.Album) {
- a, err := c.artistRepo.Get(id);
+ a, err := c.artistRepo.Get(id)
if err != nil {
beego.Error("Error reading Artist from DB", err)
c.SendError(responses.ERROR_GENERIC, "Internal Error")