Add multiple genres to Artists

This commit is contained in:
Deluan
2021-07-16 18:18:22 -04:00
committed by Deluan Quintão
parent 1d8607ef6a
commit b56e034ce3
6 changed files with 76 additions and 22 deletions
+1 -14
View File
@@ -38,6 +38,7 @@ func NewAlbumRepository(ctx context.Context, o orm.Ormer) model.AlbumRepository
"recently_added": recentlyAddedSort(),
}
r.filterMappings = map[string]filterFunc{
"id": idFilter(r.tableName),
"name": fullTextFilter,
"compilation": booleanFilter,
"artist_id": artistFilter,
@@ -267,20 +268,6 @@ func (r *albumRepository) refresh(ids ...string) error {
return err
}
func getGenres(genreIds string) model.Genres {
ids := strings.Fields(genreIds)
var genres model.Genres
unique := map[string]struct{}{}
for _, id := range ids {
if _, ok := unique[id]; ok {
continue
}
genres = append(genres, model.Genre{ID: id})
unique[id] = struct{}{}
}
return genres
}
func getAlbumArtist(al refreshAlbum) (id, name string) {
if !al.Compilation {
if al.AlbumArtist != "" {