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

@ -6,7 +6,6 @@ import {
InternetProviderLyricResponse,
FullLyricsMetadata,
LyricGetQuery,
SubsonicExtensions,
StructuredLyric,
ServerType,
} from '/@/renderer/api/types';
@ -16,6 +15,7 @@ import { queryKeys } from '/@/renderer/api/query-keys';
import { api } from '/@/renderer/api';
import isElectron from 'is-electron';
import { hasFeature } from '/@/renderer/api/utils';
import { ServerFeature } from '/@/renderer/api/features.types';
const lyricsIpc = isElectron() ? window.electron.lyrics : null;
@ -113,7 +113,7 @@ export const useSongLyricsBySong = (
source: server?.name ?? 'music server',
};
}
} else if (hasFeature(server, SubsonicExtensions.SONG_LYRICS)) {
} else if (hasFeature(server, ServerFeature.SONG_LYRICS)) {
const subsonicLyrics = await api.controller
.getStructuredLyrics({
apiClientProps: { server, signal },