Normalize server feature set

This commit is contained in:
jeffvli 2024-03-03 22:15:49 -08:00
parent dae2f9bd0a
commit f1f6ccfd02
9 changed files with 63 additions and 30 deletions

View file

@ -59,6 +59,7 @@ import packageJson from '../../../../package.json';
import { z } from 'zod';
import { JFSongListSort, JFSortOrder } from '/@/renderer/api/jellyfin.types';
import isElectron from 'is-electron';
import { ServerFeatures } from '/@/renderer/api/features.types';
const formatCommaDelimitedString = (value: string[]) => {
return value.join(',');
@ -957,7 +958,16 @@ const getServerInfo = async (args: ServerInfoArgs): Promise<ServerInfo> => {
throw new Error('Failed to get server info');
}
return { id: apiClientProps.server?.id, version: res.body.Version };
const features: ServerFeatures = {
smartPlaylists: false,
songLyrics: true,
};
return {
features,
id: apiClientProps.server?.id,
version: res.body.Version,
};
};
export const jfController = {

View file

@ -665,6 +665,10 @@ const serverInfo = z.object({
Version: z.string(),
});
export enum JellyfinExtensions {
SONG_LYRICS = 'songLyrics',
}
export const jfType = {
_enum: {
albumArtistList: albumArtistListSort,