Scanning artists and albums too

This commit is contained in:
Deluan
2016-02-28 13:50:05 -05:00
parent bccfeec2d3
commit 14e52576a7
11 changed files with 209 additions and 51 deletions
+1 -6
View File
@@ -2,8 +2,6 @@ package repositories
import (
"github.com/deluan/gosonic/models"
"fmt"
"crypto/md5"
)
type MediaFile struct {
@@ -16,9 +14,6 @@ func NewMediaFileRepository() *MediaFile {
return r
}
func (r *MediaFile) Add(m *models.MediaFile) error {
if m.Id == "" {
m.Id = fmt.Sprintf("%x", md5.Sum([]byte(m.Path)))
}
func (r *MediaFile) Put(m *models.MediaFile) error {
return r.saveOrUpdate(m.Id, m)
}