mirror of
https://github.com/navidrome/navidrome.git
synced 2025-04-15 19:50:37 +03:00
Polishing
This commit is contained in:
parent
0e20910061
commit
9099e24413
@ -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...)
|
||||
}
|
||||
|
||||
|
@ -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)
|
||||
|
Loading…
x
Reference in New Issue
Block a user