This commit is contained in:
Deluan 2016-03-09 18:46:53 -05:00
parent 2214e4bd4f
commit 7a8d591ee1
2 changed files with 6 additions and 6 deletions

View File

@ -69,7 +69,7 @@ func (c *BrowsingController) GetDirectory() {
dir, err := c.browser.Directory(id)
switch {
case err == engine.DataNotFound:
beego.Error(err, "Id:", id)
beego.Error("Requested Id", id, "not found:", err)
c.SendError(responses.ERROR_DATA_NOT_FOUND, "Directory not found")
case err != nil:
beego.Error(err)

View File

@ -63,21 +63,21 @@ func (c browser) Directory(id string) (*DirectoryInfo, error) {
var dir *DirectoryInfo
switch {
case c.isArtist(id):
beego.Info("Found Artist with id", id)
beego.Debug("Found Artist with id", id)
a, albums, err := c.retrieveArtist(id)
if err != nil {
return nil, err
}
dir = c.buildArtistDir(a, albums)
case c.isAlbum(id):
beego.Info("Found Album with id", id)
beego.Debug("Found Album with id", id)
al, tracks, err := c.retrieveAlbum(id)
if err != nil {
return nil, err
}
dir = c.buildAlbumDir(al, tracks)
default:
beego.Info("Id", id, "not found")
beego.Debug("Id", id, "not found")
return nil, DataNotFound
}
@ -138,7 +138,7 @@ func (c browser) buildAlbumDir(al *domain.Album, tracks *domain.MediaFiles) *Dir
func (c browser) isArtist(id string) bool {
found, err := c.artistRepo.Exists(id)
if err != nil {
beego.Error(fmt.Errorf("Error searching for Artist %s: %v", id, err))
beego.Debug(fmt.Errorf("Error searching for Artist %s: %v", id, err))
return false
}
return found
@ -147,7 +147,7 @@ func (c browser) isArtist(id string) bool {
func (c browser) isAlbum(id string) bool {
found, err := c.albumRepo.Exists(id)
if err != nil {
beego.Error(fmt.Errorf("Error searching for Album %s: %v", id, err))
beego.Debug(fmt.Errorf("Error searching for Album %s: %v", id, err))
return false
}
return found