Purge unused genres at the end of the scan

This commit is contained in:
Deluan
2021-07-16 18:32:22 -04:00
committed by Deluan Quintão
parent b56e034ce3
commit c56c7c865e
2 changed files with 26 additions and 0 deletions
+5
View File
@@ -165,6 +165,11 @@ func (s *SQLStore) GC(ctx context.Context, rootFolder string) error {
if err != nil {
log.Error(ctx, "Error tidying up playlists", err)
}
err = s.Genre(ctx).(*genreRepository).purgeEmpty()
if err != nil {
log.Error(ctx, "Error removing unused genres", err)
return err
}
return err
}