Polishing

This commit is contained in:
Deluan 2016-03-26 22:34:20 -04:00
parent 0e20910061
commit 9099e24413
2 changed files with 9 additions and 9 deletions

View File

@ -15,9 +15,9 @@ type Search interface {
IndexAlbum(al *domain.Album) error
IndexMediaFile(mf *domain.MediaFile) error
RemoveArtist(ids []string) error
RemoveAlbum(ids []string) error
RemoveMediaFile(ids []string) error
RemoveArtist(ids ...string) error
RemoveAlbum(ids ...string) error
RemoveMediaFile(ids ...string) error
SearchArtist(q string, offset int, size int) (Entries, error)
SearchAlbum(q string, offset int, size int) (Entries, error)
@ -72,15 +72,15 @@ func (s *search) IndexMediaFile(mf *domain.MediaFile) error {
return s.idxSong.Index(mf.Id, sanitize.Accents(strings.ToLower(mf.Title)))
}
func (s *search) RemoveArtist(ids []string) error {
func (s *search) RemoveArtist(ids ...string) error {
return s.idxArtist.Remove(ids...)
}
func (s *search) RemoveAlbum(ids []string) error {
func (s *search) RemoveAlbum(ids ...string) error {
return s.idxAlbum.Remove(ids...)
}
func (s *search) RemoveMediaFile(ids []string) error {
func (s *search) RemoveMediaFile(ids ...string) error {
return s.idxSong.Remove(ids...)
}

View File

@ -145,17 +145,17 @@ func (i *Importer) importLibrary() (err error) {
if deleted, err := i.mfRepo.PurgeInactive(mfs); err != nil {
beego.Error(err)
} else {
i.search.RemoveMediaFile(deleted)
i.search.RemoveMediaFile(deleted...)
}
if deleted, err := i.albumRepo.PurgeInactive(als); err != nil {
beego.Error(err)
} else {
i.search.RemoveAlbum(deleted)
i.search.RemoveAlbum(deleted...)
}
if deleted, err := i.artistRepo.PurgeInactive(ars); err != nil {
beego.Error(err)
} else {
i.search.RemoveArtist(deleted)
i.search.RemoveArtist(deleted...)
}
if _, err := i.plsRepo.PurgeInactive(pls); err != nil {
beego.Error(err)