mirror of
https://github.com/antebudimir/feishin.git
synced 2026-01-01 10:23:33 +00:00
Update fetchers to support search
This commit is contained in:
parent
01608fa875
commit
f8ecb3fc53
8 changed files with 69 additions and 38 deletions
|
|
@ -1,8 +1,8 @@
|
|||
import { IpcRendererEvent, ipcRenderer } from 'electron';
|
||||
import { InternetProviderLyricResponse, LyricSearchQuery, QueueSong } from '/@/renderer/api/types';
|
||||
import { ipcRenderer } from 'electron';
|
||||
import { LyricSearchQuery, QueueSong } from '/@/renderer/api/types';
|
||||
|
||||
const fetchRemoteLyrics = (song: QueueSong) => {
|
||||
const result = ipcRenderer.invoke('lyric-fetch-manual', song);
|
||||
const getRemoteLyricsBySong = (song: QueueSong) => {
|
||||
const result = ipcRenderer.invoke('lyric-by-song', song);
|
||||
return result;
|
||||
};
|
||||
|
||||
|
|
@ -11,19 +11,13 @@ const searchRemoteLyrics = (params: LyricSearchQuery) => {
|
|||
return result;
|
||||
};
|
||||
|
||||
const remoteLyricsListener = (
|
||||
cb: (
|
||||
event: IpcRendererEvent,
|
||||
songName: string,
|
||||
source: string,
|
||||
lyric: InternetProviderLyricResponse,
|
||||
) => void,
|
||||
) => {
|
||||
ipcRenderer.on('lyric-get', cb);
|
||||
const getRemoteLyricsByRemoteId = (id: string) => {
|
||||
const result = ipcRenderer.invoke('lyric-by-remote-id', id);
|
||||
return result;
|
||||
};
|
||||
|
||||
export const lyrics = {
|
||||
fetchRemoteLyrics,
|
||||
remoteLyricsListener,
|
||||
getRemoteLyricsByRemoteId,
|
||||
getRemoteLyricsBySong,
|
||||
searchRemoteLyrics,
|
||||
};
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue