mirror of
https://github.com/antebudimir/feishin.git
synced 2025-12-31 18:13:31 +00:00
[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:
parent
d52d9136b8
commit
73845a9432
7 changed files with 34 additions and 34 deletions
|
|
@ -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 };
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue