2023-06-09 02:36:38 -07:00
|
|
|
import { ipcRenderer } from 'electron';
|
|
|
|
|
import { LyricSearchQuery, QueueSong } from '/@/renderer/api/types';
|
2023-05-28 14:31:49 -07:00
|
|
|
|
2023-06-09 02:36:38 -07:00
|
|
|
const getRemoteLyricsBySong = (song: QueueSong) => {
|
|
|
|
|
const result = ipcRenderer.invoke('lyric-by-song', song);
|
2023-06-05 02:45:27 -07:00
|
|
|
return result;
|
2023-05-28 14:31:49 -07:00
|
|
|
};
|
|
|
|
|
|
2023-06-08 03:40:34 -07:00
|
|
|
const searchRemoteLyrics = (params: LyricSearchQuery) => {
|
|
|
|
|
const result = ipcRenderer.invoke('lyric-search', params);
|
|
|
|
|
return result;
|
|
|
|
|
};
|
|
|
|
|
|
2023-06-09 02:36:38 -07:00
|
|
|
const getRemoteLyricsByRemoteId = (id: string) => {
|
|
|
|
|
const result = ipcRenderer.invoke('lyric-by-remote-id', id);
|
|
|
|
|
return result;
|
2023-05-28 14:31:49 -07:00
|
|
|
};
|
|
|
|
|
|
|
|
|
|
export const lyrics = {
|
2023-06-09 02:36:38 -07:00
|
|
|
getRemoteLyricsByRemoteId,
|
|
|
|
|
getRemoteLyricsBySong,
|
2023-06-08 03:40:34 -07:00
|
|
|
searchRemoteLyrics,
|
2023-05-28 14:31:49 -07:00
|
|
|
};
|