Implemented nowplaying repo

This commit is contained in:
Deluan
2016-03-16 20:51:03 -04:00
parent f6866f23a0
commit 9bfb61d994
4 changed files with 34 additions and 12 deletions
+7 -2
View File
@@ -11,10 +11,11 @@ import (
type Scrobbler interface {
Register(id string, playDate time.Time) (*domain.MediaFile, error)
NowPlaying(id string) (*domain.MediaFile, error)
}
func NewScrobbler(itunes itunesbridge.ItunesControl, mr domain.MediaFileRepository, npr NowPlayingRepository) Scrobbler {
return scrobbler{itunes, mr, npr}
return &scrobbler{itunes, mr, npr}
}
type scrobbler struct {
@@ -23,7 +24,7 @@ type scrobbler struct {
npRepo NowPlayingRepository
}
func (s scrobbler) Register(id string, playDate time.Time) (*domain.MediaFile, error) {
func (s *scrobbler) Register(id string, playDate time.Time) (*domain.MediaFile, error) {
mf, err := s.mfRepo.Get(id)
if err != nil {
return nil, err
@@ -38,3 +39,7 @@ func (s scrobbler) Register(id string, playDate time.Time) (*domain.MediaFile, e
}
return mf, nil
}
func (s *scrobbler) NowPlaying(id string) (*domain.MediaFile, error) {
return nil, errors.New("Not implemented")
}