mirror of
https://github.com/navidrome/navidrome.git
synced 2026-11-08 11:18:41 +01:00
Removing engine.ErrDataNotFound in favor of domain.ErrNotFound
This commit is contained in:
parent
c50b0bdc48
commit
1ed8c60130
10 changed files with 15 additions and 19 deletions
|
|
@ -82,7 +82,7 @@ func (b *browser) Directory(id string) (*DirectoryInfo, error) {
|
|||
dir = b.buildAlbumDir(al, tracks)
|
||||
default:
|
||||
beego.Debug("Id", id, "not found")
|
||||
return nil, ErrDataNotFound
|
||||
return nil, domain.ErrNotFound
|
||||
}
|
||||
|
||||
return dir, nil
|
||||
|
|
|
|||
|
|
@ -1,7 +1,6 @@
|
|||
package engine
|
||||
|
||||
import (
|
||||
"errors"
|
||||
"time"
|
||||
|
||||
"github.com/deluan/gosonic/domain"
|
||||
|
|
@ -41,10 +40,6 @@ type Entry struct {
|
|||
|
||||
type Entries []Entry
|
||||
|
||||
var (
|
||||
ErrDataNotFound = errors.New("data not found")
|
||||
)
|
||||
|
||||
func FromAlbum(al *domain.Album) Entry {
|
||||
e := Entry{}
|
||||
e.Id = al.Id
|
||||
|
|
|
|||
|
|
@ -46,7 +46,7 @@ func (c *cover) Get(id string, size int, out io.Writer) error {
|
|||
}
|
||||
|
||||
if err != nil {
|
||||
return ErrDataNotFound
|
||||
return domain.ErrNotFound
|
||||
}
|
||||
|
||||
if size > 0 {
|
||||
|
|
|
|||
|
|
@ -6,6 +6,7 @@ import (
|
|||
"bytes"
|
||||
"image"
|
||||
|
||||
"github.com/deluan/gosonic/domain"
|
||||
"github.com/deluan/gosonic/engine"
|
||||
"github.com/deluan/gosonic/persistence"
|
||||
. "github.com/deluan/gosonic/tests"
|
||||
|
|
@ -53,7 +54,7 @@ func TestCover(t *testing.T) {
|
|||
err := cover.Get("2", 0, out)
|
||||
|
||||
Convey("Then it should return DatNotFound error", func() {
|
||||
So(err, ShouldEqual, engine.ErrDataNotFound)
|
||||
So(err, ShouldEqual, domain.ErrNotFound)
|
||||
})
|
||||
})
|
||||
Convey("When specifying a size", func() {
|
||||
|
|
|
|||
|
|
@ -34,9 +34,6 @@ type PlaylistInfo struct {
|
|||
|
||||
func (p *playlists) Get(id string) (*PlaylistInfo, error) {
|
||||
pl, err := p.plsRepo.Get(id)
|
||||
if err == domain.ErrNotFound {
|
||||
return nil, ErrDataNotFound
|
||||
}
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
|
|
|
|||
|
|
@ -46,7 +46,7 @@ func (r ratings) SetStar(star bool, ids ...string) error {
|
|||
}
|
||||
continue
|
||||
}
|
||||
return ErrDataNotFound
|
||||
return domain.ErrNotFound
|
||||
}
|
||||
|
||||
return nil
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue