This commit is contained in:
Deluan
2016-03-03 13:17:52 -05:00
parent f3ba23ef41
commit cd0fa5739b
2 changed files with 9 additions and 11 deletions
+5 -7
View File
@@ -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
}