[enhancement]: better version checks for lyrics, Navidrome (#529)

- Actually make serverfeatures partial
- Navidrome: only set multiple structured lyrics if extension exists
- Navidrome/Subsonic: minor type checking of OS extension (Navidrome implementation detail)
- Jellyfin: add separate knob for lyrics. Note, this should also probably be behind some version check...
This commit is contained in:
Kendall Garner 2024-03-05 08:31:51 +00:00 committed by GitHub
parent d52d9136b8
commit 73845a9432
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
7 changed files with 34 additions and 34 deletions

View file

@ -384,10 +384,7 @@ const getServerInfo = async (args: ServerInfoArgs): Promise<ServerInfo> => {
throw new Error('Failed to ping server');
}
const features: ServerFeatures = {
smartPlaylists: false,
songLyrics: false,
};
const features: ServerFeatures = {};
if (!ping.body.openSubsonic || !ping.body.serverVersion) {
return { features, version: ping.body.version };
@ -400,12 +397,14 @@ const getServerInfo = async (args: ServerInfoArgs): Promise<ServerInfo> => {
}
const subsonicFeatures: Record<string, number[]> = {};
for (const extension of res.body.openSubsonicExtensions) {
subsonicFeatures[extension.name] = extension.versions;
if (Array.isArray(res.body.openSubsonicExtensions)) {
for (const extension of res.body.openSubsonicExtensions) {
subsonicFeatures[extension.name] = extension.versions;
}
}
if (subsonicFeatures[SubsonicExtensions.SONG_LYRICS]) {
features.songLyrics = true;
features.multipleStructuredLyrics = true;
}
return { features, id: apiClientProps.server?.id, version: ping.body.serverVersion };