mirror of
https://github.com/antebudimir/feishin.git
synced 2026-01-01 10:23:33 +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
|
|
@ -96,7 +96,18 @@ export const useSongLyricsBySong = (
|
|||
if (!server) throw new Error('Server not found');
|
||||
if (!song) return null;
|
||||
|
||||
if (server.type === ServerType.JELLYFIN) {
|
||||
if (hasFeature(server, ServerFeature.MULTIPLE_STRUCTURED_LYRICS)) {
|
||||
const subsonicLyrics = await api.controller
|
||||
.getStructuredLyrics({
|
||||
apiClientProps: { server, signal },
|
||||
query: { songId: song.id },
|
||||
})
|
||||
.catch(console.error);
|
||||
|
||||
if (subsonicLyrics) {
|
||||
return subsonicLyrics;
|
||||
}
|
||||
} else if (hasFeature(server, ServerFeature.SINGLE_STRUCTURED_LYRIC)) {
|
||||
const jfLyrics = await api.controller
|
||||
.getLyrics({
|
||||
apiClientProps: { server, signal },
|
||||
|
|
@ -113,17 +124,6 @@ export const useSongLyricsBySong = (
|
|||
source: server?.name ?? 'music server',
|
||||
};
|
||||
}
|
||||
} else if (hasFeature(server, ServerFeature.SONG_LYRICS)) {
|
||||
const subsonicLyrics = await api.controller
|
||||
.getStructuredLyrics({
|
||||
apiClientProps: { server, signal },
|
||||
query: { songId: song.id },
|
||||
})
|
||||
.catch(console.error);
|
||||
|
||||
if (subsonicLyrics) {
|
||||
return subsonicLyrics;
|
||||
}
|
||||
} else if (song.lyrics) {
|
||||
return {
|
||||
artist: song.artists?.[0]?.name,
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue