fix lyrics fetch and clear (#1342)

- split server and remote lyrics into separate queries
- lyrics cache now always contain server lyrics, override will use separate remote query
- clear button is reverted to only clear the override query, and back to server
This commit is contained in:
jeffvli
2025-12-31 01:07:56 -08:00
parent 8eab4933ae
commit 255b9a9c2d
4 changed files with 207 additions and 92 deletions
+8
View File
@@ -383,6 +383,14 @@ export const queryKeys: Record<
lyricsByRemoteId: (searchQuery: { remoteSongId: string; remoteSource: LyricSource }) => {
return ['song', 'lyrics', 'remote', searchQuery] as const;
},
remoteLyrics: (serverId: string, query?: LyricsQuery) => {
if (query) return [serverId, 'song', 'lyrics', 'remote', query] as const;
return [serverId, 'song', 'lyrics', 'remote'] as const;
},
serverLyrics: (serverId: string, query?: LyricsQuery) => {
if (query) return [serverId, 'song', 'lyrics', 'server', query] as const;
return [serverId, 'song', 'lyrics', 'server'] as const;
},
lyricsSearch: (query?: LyricSearchQuery) => {
if (query) return ['lyrics', 'search', query] as const;
return ['lyrics', 'search'] as const;