fix(composers): hide performer-only artists with zero composer credits (#963)

* fix(composers): drop Navidrome role rows with zero composer albums

Navidrome can list performer-only artists under role=composer with
stats.composer.albumCount 0; filter them out of the Composers catalog
so search no longer surfaces ghost entries like Apollo 440.

* docs(changelog): credit zunoz on Psysonic Discord for PR #963
This commit is contained in:
cucadmuh
2026-06-03 22:45:52 +03:00
committed by GitHub
parent c683b5e37b
commit be21f7834f
4 changed files with 36 additions and 1 deletions
+17
View File
@@ -0,0 +1,17 @@
import { describe, expect, it } from 'vitest';
import { filterArtistsWithRoleAlbumCredits } from './composerBrowse';
describe('filterArtistsWithRoleAlbumCredits', () => {
it('removes artists with zero role-scoped album count', () => {
const artists = [
{ id: '1', name: 'Bach', albumCount: 12 },
{ id: '2', name: 'Apollo 440', albumCount: 0 },
];
expect(filterArtistsWithRoleAlbumCredits(artists)).toEqual([artists[0]]);
});
it('removes artists when role album count is missing', () => {
const artists = [{ id: '1', name: 'Ghost', albumCount: undefined }];
expect(filterArtistsWithRoleAlbumCredits(artists)).toEqual([]);
});
});
+10
View File
@@ -0,0 +1,10 @@
import type { SubsonicArtist } from '../../api/subsonicTypes';
/**
* Navidrome's `/api/artist?role=composer` can include artists whose
* `stats.composer.albumCount` is zero (performer-only credits with no composer
* tags). Drop them from the Composers browse catalog.
*/
export function filterArtistsWithRoleAlbumCredits(artists: SubsonicArtist[]): SubsonicArtist[] {
return artists.filter(a => (a.albumCount ?? 0) > 0);
}