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
+4
View File
@@ -1,6 +1,7 @@
package persistence
import (
"errors"
"github.com/deluan/gosonic/domain"
"sort"
)
@@ -16,6 +17,9 @@ func NewMediaFileRepository() domain.MediaFileRepository {
}
func (r *mediaFileRepository) Put(m *domain.MediaFile) error {
if m.Id == "" {
return errors.New("MediaFile Id is not set")
}
return r.saveOrUpdate(m.Id, m)
}