Now Playing backend implemented

This commit is contained in:
Deluan
2016-03-16 21:04:41 -04:00
parent 9bfb61d994
commit cc89cb5bd1
6 changed files with 49 additions and 11 deletions
+10 -1
View File
@@ -41,5 +41,14 @@ func (s *scrobbler) Register(id string, playDate time.Time) (*domain.MediaFile,
}
func (s *scrobbler) NowPlaying(id string) (*domain.MediaFile, error) {
return nil, errors.New("Not implemented")
mf, err := s.mfRepo.Get(id)
if err != nil {
return nil, err
}
if mf == nil {
return nil, errors.New(fmt.Sprintf(`Id "%s" not found`, id))
}
return mf, s.npRepo.Set(id)
}