Big Importer/Scanner refactor

This commit is contained in:
Deluan
2016-03-04 16:42:09 -05:00
parent 7225807bad
commit 766fdbc60c
8 changed files with 205 additions and 152 deletions
+2 -1
View File
@@ -1,6 +1,7 @@
package persistence
import (
"errors"
"github.com/deluan/gosonic/domain"
)
@@ -16,7 +17,7 @@ func NewAlbumRepository() domain.AlbumRepository {
func (r *albumRepository) Put(m *domain.Album) error {
if m.Id == "" {
m.Id = r.NewId(m.ArtistId, m.Name)
return errors.New("Album Id is not set")
}
return r.saveOrUpdate(m.Id, m)
}