mirror of
https://github.com/jeffvli/feishin.git
synced 2026-05-15 21:16:17 +02: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:
@@ -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 };
|
||||
|
||||
Reference in New Issue
Block a user