ND >= 0.56.0: search songs by artist | album artist id

This commit is contained in:
Kendall Garner 2025-09-27 20:00:34 -07:00
parent c448352ec8
commit 508013958f
No known key found for this signature in database
GPG key ID: 9355F387FE765C94
4 changed files with 25 additions and 37 deletions

View file

@ -251,6 +251,7 @@ const songListParameters = paginationParameters.extend({
album_artist_id: z.array(z.string()).optional(),
album_id: z.array(z.string()).optional(),
artist_id: z.array(z.string()).optional(),
artists_id: z.array(z.string()).optional(),
genre_id: z.array(z.string()).optional(),
path: z.string().optional(),
starred: z.boolean().optional(),

View file

@ -36,7 +36,9 @@ export const hasFeature = (server: null | ServerListItem, feature: ServerFeature
return (server.features[feature]?.length || 0) > 0;
};
export type VersionInfo = ReadonlyArray<[string, Record<string, readonly number[]>]>;
export type VersionInfo = ReadonlyArray<
[string, Partial<Record<ServerFeature, readonly number[]>>]
>;
/**
* Returns the available server features given the version string.
@ -61,9 +63,9 @@ export type VersionInfo = ReadonlyArray<[string, Record<string, readonly number[
export const getFeatures = (
versionInfo: VersionInfo,
version: string,
): Record<string, number[]> => {
): Partial<Record<ServerFeature, number[]>> => {
const cleanVersion = semverCoerce(version);
const features: Record<string, number[]> = {};
const features: Partial<Record<ServerFeature, number[]>> = {};
let matched = cleanVersion === null;
for (const [version, supportedFeatures] of versionInfo) {

View file

@ -8,6 +8,7 @@ export enum ServerFeature {
PUBLIC_PLAYLIST = 'publicPlaylist',
SHARING_ALBUM_SONG = 'sharingAlbumSong',
TAGS = 'tags',
TRACK_ALBUM_ARTIST_SEARCH = 'trackAlbumArtistSearch',
}
export type ServerFeatures = Partial<Record<ServerFeature, number[]>>;